diff --git a/AUTHORS b/AUTHORS
index 3566e5207..6a1729494 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -9,4 +9,8 @@ Federico Maguolo (maguolof@dei.unipd.it)
George F. Riley (riley@ece.gatech.edu)
Guillaume Vu-Brugier (gvubrugier@gmail.com)
Florian Westphal (fw@strlen.de)
+Sebastien Vincent (vincent@lsiit.u-strasbg.fr)
+David Gross (gdavid.devel@gmail.com)
+Mehdi Benamor (mehdi.benamor@telecom-bretagne.eu)
+Angelos Chatzipapas (chatzipa@ceid.upatras.gr)
diff --git a/CHANGES.html b/CHANGES.html
index 38326fe84..82e79eb9b 100644
--- a/CHANGES.html
+++ b/CHANGES.html
@@ -43,6 +43,69 @@ the cracks, unfortunately. If you, as a user, can suggest improvements
to this file based on your experience, please contribute a patch or drop
us a note on ns-developers mailing list.
+
+changes from ns-3.2 to ns-3.3
+
+new API:
+
+
+17-11-2008; changeset
+4c1c3f6bcd03
+
+
+The PppHeader previously defined in the point-to-point-net-device code has been
+made public.
+
+
+
+17-11-2008; changeset
+16c2970a0344
+
+
+An emulated net device has been added as enabling technology for ns-3 emulation
+scenarios. See src/devices/emu and examples/emu-udp-echo.cc for details.
+
+
+
+
+new API in existing classes:
+
+
+17-11-2008; changeset
+4222173d1e6d
+
+
+Added method InternetStackHelper::EnableAsciiChange to allow allow a user to
+hook ascii trace to the drop trace events in Ipv4L3Protocol and ArpL3Protocol.
+
+
+
+
+changes to existing API:
+
+
+17-11-2008; changeset
+dacfd1f07538
+
+
+Change attribute "RxErrorModel" to "ReceiveErrorModel" in CsmaNetDevice for
+consistency between devices.
+
+
+
+
+changed behavior:
+
+
+17-11-2008; changeset
+ed0dfce40459
+
+
+Relax reasonableness testing in Ipv4AddressHelper::SetBase to allow the
+assignment of /32 addresses.
+
+
+
changes from ns-3.1 to ns-3.2
@@ -171,7 +234,6 @@ when the m_promiscRxCallback is called.
-
03-07-2008; changeset
d5f8e5fae1c6
diff --git a/bindings/python/callbacks_list.py b/bindings/python/callbacks_list.py
index d26a26a6d..db7a40c2c 100644
--- a/bindings/python/callbacks_list.py
+++ b/bindings/python/callbacks_list.py
@@ -1,10 +1,10 @@
callback_classes = [
['void', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'],
+ ['void', 'ns3::Ptr', 'ns3::Mac48Address', 'ns3::Mac48Address', 'ns3::empty', 'ns3::empty', 'ns3::empty'],
['void', 'ns3::Ptr', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'],
['void', 'ns3::Ptr', 'unsigned int', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'],
['void', 'ns3::Ptr', 'ns3::Address const&', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'],
['bool', 'ns3::Ptr', 'ns3::Address const&', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'],
- ['void', 'ns3::Ptr', 'ns3::Mac48Address', 'ns3::Mac48Address', 'ns3::empty', 'ns3::empty', 'ns3::empty'],
['bool', 'ns3::Ptr', 'ns3::Ptr', 'unsigned short', 'ns3::Address const&', 'ns3::Address const&', 'ns3::NetDevice::PacketType'],
['bool', 'ns3::Ptr', 'ns3::Ptr', 'unsigned short', 'ns3::Address const&', 'ns3::empty', 'ns3::empty'],
['void', 'ns3::Ptr', 'ns3::Ptr', 'unsigned short', 'ns3::Address const&', 'ns3::Address const&', 'ns3::NetDevice::PacketType'],
diff --git a/bindings/python/ns3_module_bridge.py b/bindings/python/ns3_module_bridge.py
index 8790cf43f..db78c6d34 100644
--- a/bindings/python/ns3_module_bridge.py
+++ b/bindings/python/ns3_module_bridge.py
@@ -8,10 +8,10 @@ def register_types(module):
## bridge-net-device.h: ns3::BridgeNetDevice [class]
module.add_class('BridgeNetDevice', parent=root_module['ns3::NetDevice'])
- ## Register a nested module for the namespace internal
+ ## Register a nested module for the namespace Config
- nested_module = module.add_cpp_namespace('internal')
- register_types_ns3_internal(nested_module)
+ nested_module = module.add_cpp_namespace('Config')
+ register_types_ns3_Config(nested_module)
## Register a nested module for the namespace TimeStepPrecision
@@ -20,10 +20,10 @@ def register_types(module):
register_types_ns3_TimeStepPrecision(nested_module)
- ## Register a nested module for the namespace Config
+ ## Register a nested module for the namespace internal
- nested_module = module.add_cpp_namespace('Config')
- register_types_ns3_Config(nested_module)
+ nested_module = module.add_cpp_namespace('internal')
+ register_types_ns3_internal(nested_module)
## Register a nested module for the namespace olsr
@@ -32,7 +32,7 @@ def register_types(module):
register_types_ns3_olsr(nested_module)
-def register_types_ns3_internal(module):
+def register_types_ns3_Config(module):
root_module = module.get_root()
@@ -40,7 +40,7 @@ def register_types_ns3_TimeStepPrecision(module):
root_module = module.get_root()
-def register_types_ns3_Config(module):
+def register_types_ns3_internal(module):
root_module = module.get_root()
@@ -158,13 +158,8 @@ def register_Ns3BridgeNetDevice_methods(root_module, cls):
'bool',
[],
is_const=True, is_virtual=True)
- ## bridge-net-device.h: ns3::Address ns3::BridgeNetDevice::GetMulticast() const [member function]
+ ## bridge-net-device.h: ns3::Address ns3::BridgeNetDevice::GetMulticast(ns3::Ipv4Address multicastGroup) const [member function]
cls.add_method('GetMulticast',
- 'ns3::Address',
- [],
- is_const=True, is_virtual=True)
- ## bridge-net-device.h: ns3::Address ns3::BridgeNetDevice::MakeMulticastAddress(ns3::Ipv4Address multicastGroup) const [member function]
- cls.add_method('MakeMulticastAddress',
'ns3::Address',
[param('ns3::Ipv4Address', 'multicastGroup')],
is_const=True, is_virtual=True)
@@ -213,6 +208,11 @@ def register_Ns3BridgeNetDevice_methods(root_module, cls):
'bool',
[],
is_const=True, is_virtual=True)
+ ## bridge-net-device.h: ns3::Address ns3::BridgeNetDevice::GetMulticast(ns3::Ipv6Address addr) const [member function]
+ cls.add_method('GetMulticast',
+ 'ns3::Address',
+ [param('ns3::Ipv6Address', 'addr')],
+ is_const=True, is_virtual=True)
## bridge-net-device.h: void ns3::BridgeNetDevice::DoDispose() [member function]
cls.add_method('DoDispose',
'void',
@@ -247,21 +247,21 @@ def register_Ns3BridgeNetDevice_methods(root_module, cls):
def register_functions(root_module):
module = root_module
- register_functions_ns3_internal(module.get_submodule('internal'), root_module)
- register_functions_ns3_TimeStepPrecision(module.get_submodule('TimeStepPrecision'), 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_internal(module, root_module):
- return
-
-def register_functions_ns3_TimeStepPrecision(module, 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
diff --git a/bindings/python/ns3_module_common.py b/bindings/python/ns3_module_common.py
index e4d4aff67..7877692dd 100644
--- a/bindings/python/ns3_module_common.py
+++ b/bindings/python/ns3_module_common.py
@@ -54,10 +54,10 @@ def register_types(module):
## error-model.h: ns3::RateErrorModel [class]
module.add_class('RateErrorModel', parent=root_module['ns3::ErrorModel'])
- ## Register a nested module for the namespace internal
+ ## Register a nested module for the namespace Config
- nested_module = module.add_cpp_namespace('internal')
- register_types_ns3_internal(nested_module)
+ nested_module = module.add_cpp_namespace('Config')
+ register_types_ns3_Config(nested_module)
## Register a nested module for the namespace TimeStepPrecision
@@ -66,10 +66,10 @@ def register_types(module):
register_types_ns3_TimeStepPrecision(nested_module)
- ## Register a nested module for the namespace Config
+ ## Register a nested module for the namespace internal
- nested_module = module.add_cpp_namespace('Config')
- register_types_ns3_Config(nested_module)
+ nested_module = module.add_cpp_namespace('internal')
+ register_types_ns3_internal(nested_module)
## Register a nested module for the namespace olsr
@@ -78,7 +78,7 @@ def register_types(module):
register_types_ns3_olsr(nested_module)
-def register_types_ns3_internal(module):
+def register_types_ns3_Config(module):
root_module = module.get_root()
@@ -86,7 +86,7 @@ def register_types_ns3_TimeStepPrecision(module):
root_module = module.get_root()
-def register_types_ns3_Config(module):
+def register_types_ns3_internal(module):
root_module = module.get_root()
@@ -1118,21 +1118,21 @@ def register_functions(root_module):
module.add_function('MakeDataRateChecker',
'ns3::Ptr< ns3::AttributeChecker const >',
[])
- register_functions_ns3_internal(module.get_submodule('internal'), root_module)
- register_functions_ns3_TimeStepPrecision(module.get_submodule('TimeStepPrecision'), 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_internal(module, root_module):
- return
-
-def register_functions_ns3_TimeStepPrecision(module, 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
diff --git a/bindings/python/ns3_module_contrib.py b/bindings/python/ns3_module_contrib.py
index 53ff8b169..610813da8 100644
--- a/bindings/python/ns3_module_contrib.py
+++ b/bindings/python/ns3_module_contrib.py
@@ -22,10 +22,10 @@ def register_types(module):
## flow-id-tag.h: ns3::FlowIdTag [class]
module.add_class('FlowIdTag', parent=root_module['ns3::Tag'])
- ## Register a nested module for the namespace internal
+ ## Register a nested module for the namespace Config
- nested_module = module.add_cpp_namespace('internal')
- register_types_ns3_internal(nested_module)
+ nested_module = module.add_cpp_namespace('Config')
+ register_types_ns3_Config(nested_module)
## Register a nested module for the namespace TimeStepPrecision
@@ -34,10 +34,10 @@ def register_types(module):
register_types_ns3_TimeStepPrecision(nested_module)
- ## Register a nested module for the namespace Config
+ ## Register a nested module for the namespace internal
- nested_module = module.add_cpp_namespace('Config')
- register_types_ns3_Config(nested_module)
+ nested_module = module.add_cpp_namespace('internal')
+ register_types_ns3_internal(nested_module)
## Register a nested module for the namespace olsr
@@ -46,7 +46,7 @@ def register_types(module):
register_types_ns3_olsr(nested_module)
-def register_types_ns3_internal(module):
+def register_types_ns3_Config(module):
root_module = module.get_root()
@@ -54,7 +54,7 @@ def register_types_ns3_TimeStepPrecision(module):
root_module = module.get_root()
-def register_types_ns3_Config(module):
+def register_types_ns3_internal(module):
root_module = module.get_root()
@@ -240,21 +240,21 @@ def register_Ns3FlowIdTag_methods(root_module, cls):
def register_functions(root_module):
module = root_module
- register_functions_ns3_internal(module.get_submodule('internal'), root_module)
- register_functions_ns3_TimeStepPrecision(module.get_submodule('TimeStepPrecision'), 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_internal(module, root_module):
- return
-
-def register_functions_ns3_TimeStepPrecision(module, 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
diff --git a/bindings/python/ns3_module_core.py b/bindings/python/ns3_module_core.py
index ef6df5af2..8943021fe 100644
--- a/bindings/python/ns3_module_core.py
+++ b/bindings/python/ns3_module_core.py
@@ -166,10 +166,10 @@ def register_types(module):
## traced-value.h: ns3::TracedValue [class]
root_module['ns3::TracedValue< unsigned int >'].implicitly_converts_to(root_module['ns3::EnumValue'])
- ## Register a nested module for the namespace internal
+ ## Register a nested module for the namespace Config
- nested_module = module.add_cpp_namespace('internal')
- register_types_ns3_internal(nested_module)
+ nested_module = module.add_cpp_namespace('Config')
+ register_types_ns3_Config(nested_module)
## Register a nested module for the namespace TimeStepPrecision
@@ -178,10 +178,10 @@ def register_types(module):
register_types_ns3_TimeStepPrecision(nested_module)
- ## Register a nested module for the namespace Config
+ ## Register a nested module for the namespace internal
- nested_module = module.add_cpp_namespace('Config')
- register_types_ns3_Config(nested_module)
+ nested_module = module.add_cpp_namespace('internal')
+ register_types_ns3_internal(nested_module)
## Register a nested module for the namespace olsr
@@ -190,14 +190,6 @@ def register_types(module):
register_types_ns3_olsr(nested_module)
-def register_types_ns3_internal(module):
- root_module = module.get_root()
-
-
-def register_types_ns3_TimeStepPrecision(module):
- root_module = module.get_root()
-
-
def register_types_ns3_Config(module):
root_module = module.get_root()
@@ -205,6 +197,14 @@ def register_types_ns3_Config(module):
module.add_class('MatchContainer')
module.add_container('std::vector< ns3::Ptr< ns3::Object > >', 'ns3::Ptr< ns3::Object >', container_type='vector')
+def register_types_ns3_TimeStepPrecision(module):
+ root_module = module.get_root()
+
+
+def register_types_ns3_internal(module):
+ root_module = module.get_root()
+
+
def register_types_ns3_olsr(module):
root_module = module.get_root()
@@ -828,12 +828,12 @@ def register_Ns3TypeId_methods(root_module, cls):
cls.add_binary_comparison_operator('<')
cls.add_output_stream_operator()
cls.add_binary_comparison_operator('==')
- ## type-id.h: ns3::TypeId::TypeId(ns3::TypeId const & arg0) [copy constructor]
- cls.add_constructor([param('ns3::TypeId const &', 'arg0')])
## type-id.h: ns3::TypeId::TypeId(char const * name) [constructor]
cls.add_constructor([param('char const *', 'name')])
## type-id.h: ns3::TypeId::TypeId() [constructor]
cls.add_constructor([])
+ ## type-id.h: ns3::TypeId::TypeId(ns3::TypeId const & o) [copy constructor]
+ cls.add_constructor([param('ns3::TypeId const &', 'o')])
## type-id.h: ns3::TypeId ns3::TypeId::AddAttribute(std::string name, std::string help, ns3::AttributeValue const & initialValue, ns3::Ptr accessor, ns3::Ptr checker) [member function]
cls.add_method('AddAttribute',
'ns3::TypeId',
@@ -1986,10 +1986,64 @@ def register_Ns3ConfigMatchContainer_methods(root_module, cls):
def register_functions(root_module):
module = root_module
+ ## breakpoint.h: extern void ns3::BreakpointFallback() [free function]
+ module.add_function('BreakpointFallback',
+ 'void',
+ [])
+ ## ptr.h: extern ns3::Ptr ns3::Create() [free function]
+ module.add_function('Create',
+ 'ns3::Ptr< ns3::ObjectVectorValue >',
+ [],
+ template_parameters=['ns3::ObjectVectorValue'])
+ ## ptr.h: extern ns3::Ptr ns3::Create() [free function]
+ module.add_function('Create',
+ 'ns3::Ptr< ns3::PointerValue >',
+ [],
+ template_parameters=['ns3::PointerValue'])
+ ## log.h: extern void ns3::LogComponentDisable(char const * name, ns3::LogLevel level) [free function]
+ module.add_function('LogComponentDisable',
+ 'void',
+ [param('char const *', 'name'), param('ns3::LogLevel', 'level')])
+ ## log.h: extern void ns3::LogComponentDisableAll(ns3::LogLevel level) [free function]
+ module.add_function('LogComponentDisableAll',
+ 'void',
+ [param('ns3::LogLevel', 'level')])
+ ## log.h: extern void ns3::LogComponentEnable(char const * name, ns3::LogLevel level) [free function]
+ module.add_function('LogComponentEnable',
+ 'void',
+ [param('char const *', 'name'), param('ns3::LogLevel', 'level')])
+ ## log.h: extern void ns3::LogComponentEnableAll(ns3::LogLevel level) [free function]
+ module.add_function('LogComponentEnableAll',
+ 'void',
+ [param('ns3::LogLevel', 'level')])
## boolean.h: extern ns3::Ptr ns3::MakeBooleanChecker() [free function]
module.add_function('MakeBooleanChecker',
'ns3::Ptr< ns3::AttributeChecker const >',
[])
+ ## callback.h: extern ns3::Ptr ns3::MakeCallbackChecker() [free function]
+ module.add_function('MakeCallbackChecker',
+ 'ns3::Ptr< ns3::AttributeChecker const >',
+ [])
+ ## enum.h: extern ns3::Ptr ns3::MakeEnumChecker(int v1, std::string n1, int v2=0, std::string n2="", int v3=0, std::string n3="", int v4=0, std::string n4="", int v5=0, std::string n5="", int v6=0, std::string n6="", int v7=0, std::string n7="", int v8=0, std::string n8="", int v9=0, std::string n9="", int v10=0, std::string n10="", int v11=0, std::string n11="", int v12=0, std::string n12="") [free function]
+ module.add_function('MakeEnumChecker',
+ 'ns3::Ptr< ns3::AttributeChecker const >',
+ [param('int', 'v1'), param('std::string', 'n1'), param('int', 'v2', default_value='0'), param('std::string', 'n2', default_value='""'), param('int', 'v3', default_value='0'), param('std::string', 'n3', default_value='""'), param('int', 'v4', default_value='0'), param('std::string', 'n4', default_value='""'), param('int', 'v5', default_value='0'), param('std::string', 'n5', default_value='""'), param('int', 'v6', default_value='0'), param('std::string', 'n6', default_value='""'), param('int', 'v7', default_value='0'), param('std::string', 'n7', default_value='""'), param('int', 'v8', default_value='0'), param('std::string', 'n8', default_value='""'), param('int', 'v9', default_value='0'), param('std::string', 'n9', default_value='""'), param('int', 'v10', default_value='0'), param('std::string', 'n10', default_value='""'), param('int', 'v11', default_value='0'), param('std::string', 'n11', default_value='""'), param('int', 'v12', default_value='0'), param('std::string', 'n12', default_value='""')])
+ ## object-factory.h: extern ns3::Ptr ns3::MakeObjectFactoryChecker() [free function]
+ module.add_function('MakeObjectFactoryChecker',
+ 'ns3::Ptr< ns3::AttributeChecker const >',
+ [])
+ ## random-variable.h: extern ns3::Ptr ns3::MakeRandomVariableChecker() [free function]
+ module.add_function('MakeRandomVariableChecker',
+ 'ns3::Ptr< ns3::AttributeChecker const >',
+ [])
+ ## string.h: extern ns3::Ptr ns3::MakeStringChecker() [free function]
+ module.add_function('MakeStringChecker',
+ 'ns3::Ptr< ns3::AttributeChecker const >',
+ [])
+ ## type-id.h: extern ns3::Ptr ns3::MakeTypeIdChecker() [free function]
+ module.add_function('MakeTypeIdChecker',
+ 'ns3::Ptr< ns3::AttributeChecker const >',
+ [])
## type-name.h: extern std::string ns3::TypeNameGet() [free function]
module.add_function('TypeNameGet',
'std::string',
@@ -2040,141 +2094,87 @@ def register_functions(root_module):
'std::string',
[],
template_parameters=['unsigned char'])
- ## log.h: extern void ns3::LogComponentDisable(char const * name, ns3::LogLevel level) [free function]
- module.add_function('LogComponentDisable',
- 'void',
- [param('char const *', 'name'), param('ns3::LogLevel', 'level')])
- ## string.h: extern ns3::Ptr ns3::MakeStringChecker() [free function]
- module.add_function('MakeStringChecker',
- 'ns3::Ptr< ns3::AttributeChecker const >',
- [])
- ## ptr.h: extern ns3::Ptr ns3::Create() [free function]
- module.add_function('Create',
- 'ns3::Ptr< ns3::PointerValue >',
- [],
- template_parameters=['ns3::PointerValue'])
- ## ptr.h: extern ns3::Ptr ns3::Create() [free function]
- module.add_function('Create',
- 'ns3::Ptr< ns3::ObjectVectorValue >',
- [],
- template_parameters=['ns3::ObjectVectorValue'])
- ## log.h: extern void ns3::LogComponentEnableAll(ns3::LogLevel level) [free function]
- module.add_function('LogComponentEnableAll',
- 'void',
- [param('ns3::LogLevel', 'level')])
- ## type-id.h: extern ns3::Ptr ns3::MakeTypeIdChecker() [free function]
- module.add_function('MakeTypeIdChecker',
- 'ns3::Ptr< ns3::AttributeChecker const >',
- [])
- ## object-factory.h: extern ns3::Ptr ns3::MakeObjectFactoryChecker() [free function]
- module.add_function('MakeObjectFactoryChecker',
- 'ns3::Ptr< ns3::AttributeChecker const >',
- [])
- ## log.h: extern void ns3::LogComponentDisableAll(ns3::LogLevel level) [free function]
- module.add_function('LogComponentDisableAll',
- 'void',
- [param('ns3::LogLevel', 'level')])
- ## callback.h: extern ns3::Ptr ns3::MakeCallbackChecker() [free function]
- module.add_function('MakeCallbackChecker',
- 'ns3::Ptr< ns3::AttributeChecker const >',
- [])
- ## breakpoint.h: extern void ns3::BreakpointFallback() [free function]
- module.add_function('BreakpointFallback',
- 'void',
- [])
- ## random-variable.h: extern ns3::Ptr ns3::MakeRandomVariableChecker() [free function]
- module.add_function('MakeRandomVariableChecker',
- 'ns3::Ptr< ns3::AttributeChecker const >',
- [])
- ## log.h: extern void ns3::LogComponentEnable(char const * name, ns3::LogLevel level) [free function]
- module.add_function('LogComponentEnable',
- 'void',
- [param('char const *', 'name'), param('ns3::LogLevel', 'level')])
- ## enum.h: extern ns3::Ptr ns3::MakeEnumChecker(int v1, std::string n1, int v2=0, std::string n2="", int v3=0, std::string n3="", int v4=0, std::string n4="", int v5=0, std::string n5="", int v6=0, std::string n6="", int v7=0, std::string n7="", int v8=0, std::string n8="", int v9=0, std::string n9="", int v10=0, std::string n10="", int v11=0, std::string n11="", int v12=0, std::string n12="") [free function]
- module.add_function('MakeEnumChecker',
- 'ns3::Ptr< ns3::AttributeChecker const >',
- [param('int', 'v1'), param('std::string', 'n1'), param('int', 'v2', default_value='0'), param('std::string', 'n2', default_value='""'), param('int', 'v3', default_value='0'), param('std::string', 'n3', default_value='""'), param('int', 'v4', default_value='0'), param('std::string', 'n4', default_value='""'), param('int', 'v5', default_value='0'), param('std::string', 'n5', default_value='""'), param('int', 'v6', default_value='0'), param('std::string', 'n6', default_value='""'), param('int', 'v7', default_value='0'), param('std::string', 'n7', default_value='""'), param('int', 'v8', default_value='0'), param('std::string', 'n8', default_value='""'), param('int', 'v9', default_value='0'), param('std::string', 'n9', default_value='""'), param('int', 'v10', default_value='0'), param('std::string', 'n10', default_value='""'), param('int', 'v11', default_value='0'), param('std::string', 'n11', default_value='""'), param('int', 'v12', default_value='0'), param('std::string', 'n12', default_value='""')])
- register_functions_ns3_internal(module.get_submodule('internal'), root_module)
- register_functions_ns3_TimeStepPrecision(module.get_submodule('TimeStepPrecision'), 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_internal(module, root_module):
- ## uinteger.h: extern ns3::Ptr ns3::internal::MakeUintegerChecker(uint64_t min, uint64_t max, std::string name) [free function]
- module.add_function('MakeUintegerChecker',
- 'ns3::Ptr< ns3::AttributeChecker const >',
- [param('uint64_t', 'min'), param('uint64_t', 'max'), param('std::string', 'name')])
- ## integer.h: extern ns3::Ptr ns3::internal::MakeIntegerChecker(int64_t min, int64_t max, std::string name) [free function]
- module.add_function('MakeIntegerChecker',
- 'ns3::Ptr< ns3::AttributeChecker const >',
- [param('int64_t', 'min'), param('int64_t', 'max'), param('std::string', 'name')])
- ## double.h: extern ns3::Ptr ns3::internal::MakeDoubleChecker(double min, double max, std::string name) [free function]
- module.add_function('MakeDoubleChecker',
- 'ns3::Ptr< ns3::AttributeChecker const >',
- [param('double', 'min'), param('double', 'max'), param('std::string', 'name')])
- return
-
-def register_functions_ns3_TimeStepPrecision(module, root_module):
- return
-
def register_functions_ns3_Config(module, root_module):
- ## config.h: extern bool ns3::Config::SetDefaultFailSafe(std::string name, ns3::AttributeValue const & value) [free function]
- module.add_function('SetDefaultFailSafe',
- 'bool',
- [param('std::string', 'name'), param('ns3::AttributeValue const &', 'value')])
- ## config.h: extern void ns3::Config::DisconnectWithoutContext(std::string path, ns3::CallbackBase const & cb) [free function]
- module.add_function('DisconnectWithoutContext',
- 'void',
- [param('std::string', 'path'), param('ns3::CallbackBase const &', 'cb')])
- ## config.h: extern void ns3::Config::SetDefault(std::string name, ns3::AttributeValue const & value) [free function]
- module.add_function('SetDefault',
- 'void',
- [param('std::string', 'name'), param('ns3::AttributeValue const &', 'value')])
- ## config.h: extern ns3::Config::MatchContainer ns3::Config::LookupMatches(std::string path) [free function]
- module.add_function('LookupMatches',
- 'ns3::Config::MatchContainer',
- [param('std::string', 'path')])
## config.h: extern void ns3::Config::Connect(std::string path, ns3::CallbackBase const & cb) [free function]
module.add_function('Connect',
'void',
[param('std::string', 'path'), param('ns3::CallbackBase const &', 'cb')])
+ ## config.h: extern void ns3::Config::ConnectWithoutContext(std::string path, ns3::CallbackBase const & cb) [free function]
+ module.add_function('ConnectWithoutContext',
+ 'void',
+ [param('std::string', 'path'), param('ns3::CallbackBase const &', 'cb')])
+ ## config.h: extern void ns3::Config::Disconnect(std::string path, ns3::CallbackBase const & cb) [free function]
+ module.add_function('Disconnect',
+ 'void',
+ [param('std::string', 'path'), param('ns3::CallbackBase const &', 'cb')])
+ ## config.h: extern void ns3::Config::DisconnectWithoutContext(std::string path, ns3::CallbackBase const & cb) [free function]
+ module.add_function('DisconnectWithoutContext',
+ 'void',
+ [param('std::string', 'path'), param('ns3::CallbackBase const &', 'cb')])
## config.h: extern ns3::Ptr ns3::Config::GetRootNamespaceObject(uint32_t i) [free function]
module.add_function('GetRootNamespaceObject',
'ns3::Ptr< ns3::Object >',
[param('uint32_t', 'i')])
- ## config.h: extern void ns3::Config::ConnectWithoutContext(std::string path, ns3::CallbackBase const & cb) [free function]
- module.add_function('ConnectWithoutContext',
- 'void',
- [param('std::string', 'path'), param('ns3::CallbackBase const &', 'cb')])
- ## config.h: extern void ns3::Config::UnregisterRootNamespaceObject(ns3::Ptr obj) [free function]
- module.add_function('UnregisterRootNamespaceObject',
- 'void',
- [param('ns3::Ptr< ns3::Object >', 'obj')])
- ## config.h: extern bool ns3::Config::SetGlobalFailSafe(std::string name, ns3::AttributeValue const & value) [free function]
- module.add_function('SetGlobalFailSafe',
- 'bool',
- [param('std::string', 'name'), param('ns3::AttributeValue const &', 'value')])
- ## config.h: extern void ns3::Config::Disconnect(std::string path, ns3::CallbackBase const & cb) [free function]
- module.add_function('Disconnect',
- 'void',
- [param('std::string', 'path'), param('ns3::CallbackBase const &', 'cb')])
## config.h: extern uint32_t ns3::Config::GetRootNamespaceObjectN() [free function]
module.add_function('GetRootNamespaceObjectN',
'uint32_t',
[])
- ## config.h: extern void ns3::Config::Set(std::string path, ns3::AttributeValue const & value) [free function]
- module.add_function('Set',
- 'void',
- [param('std::string', 'path'), param('ns3::AttributeValue const &', 'value')])
- ## config.h: extern void ns3::Config::SetGlobal(std::string name, ns3::AttributeValue const & value) [free function]
- module.add_function('SetGlobal',
- 'void',
- [param('std::string', 'name'), param('ns3::AttributeValue const &', 'value')])
+ ## config.h: extern ns3::Config::MatchContainer ns3::Config::LookupMatches(std::string path) [free function]
+ module.add_function('LookupMatches',
+ 'ns3::Config::MatchContainer',
+ [param('std::string', 'path')])
## config.h: extern void ns3::Config::RegisterRootNamespaceObject(ns3::Ptr obj) [free function]
module.add_function('RegisterRootNamespaceObject',
'void',
[param('ns3::Ptr< ns3::Object >', 'obj')])
+ ## config.h: extern void ns3::Config::Set(std::string path, ns3::AttributeValue const & value) [free function]
+ module.add_function('Set',
+ 'void',
+ [param('std::string', 'path'), param('ns3::AttributeValue const &', 'value')])
+ ## config.h: extern void ns3::Config::SetDefault(std::string name, ns3::AttributeValue const & value) [free function]
+ module.add_function('SetDefault',
+ 'void',
+ [param('std::string', 'name'), param('ns3::AttributeValue const &', 'value')])
+ ## config.h: extern bool ns3::Config::SetDefaultFailSafe(std::string name, ns3::AttributeValue const & value) [free function]
+ module.add_function('SetDefaultFailSafe',
+ 'bool',
+ [param('std::string', 'name'), param('ns3::AttributeValue const &', 'value')])
+ ## config.h: extern void ns3::Config::SetGlobal(std::string name, ns3::AttributeValue const & value) [free function]
+ module.add_function('SetGlobal',
+ 'void',
+ [param('std::string', 'name'), param('ns3::AttributeValue const &', 'value')])
+ ## config.h: extern bool ns3::Config::SetGlobalFailSafe(std::string name, ns3::AttributeValue const & value) [free function]
+ module.add_function('SetGlobalFailSafe',
+ 'bool',
+ [param('std::string', 'name'), param('ns3::AttributeValue const &', 'value')])
+ ## config.h: extern void ns3::Config::UnregisterRootNamespaceObject(ns3::Ptr obj) [free function]
+ module.add_function('UnregisterRootNamespaceObject',
+ 'void',
+ [param('ns3::Ptr< ns3::Object >', 'obj')])
+ return
+
+def register_functions_ns3_TimeStepPrecision(module, root_module):
+ return
+
+def register_functions_ns3_internal(module, root_module):
+ ## double.h: extern ns3::Ptr ns3::internal::MakeDoubleChecker(double min, double max, std::string name) [free function]
+ module.add_function('MakeDoubleChecker',
+ 'ns3::Ptr< ns3::AttributeChecker const >',
+ [param('double', 'min'), param('double', 'max'), param('std::string', 'name')])
+ ## integer.h: extern ns3::Ptr ns3::internal::MakeIntegerChecker(int64_t min, int64_t max, std::string name) [free function]
+ module.add_function('MakeIntegerChecker',
+ 'ns3::Ptr< ns3::AttributeChecker const >',
+ [param('int64_t', 'min'), param('int64_t', 'max'), param('std::string', 'name')])
+ ## uinteger.h: extern ns3::Ptr ns3::internal::MakeUintegerChecker(uint64_t min, uint64_t max, std::string name) [free function]
+ module.add_function('MakeUintegerChecker',
+ 'ns3::Ptr< ns3::AttributeChecker const >',
+ [param('uint64_t', 'min'), param('uint64_t', 'max'), param('std::string', 'name')])
return
def register_functions_ns3_olsr(module, root_module):
diff --git a/bindings/python/ns3_module_csma.py b/bindings/python/ns3_module_csma.py
index ddcaae307..db2b1ed43 100644
--- a/bindings/python/ns3_module_csma.py
+++ b/bindings/python/ns3_module_csma.py
@@ -16,10 +16,10 @@ def register_types(module):
## csma-net-device.h: ns3::CsmaNetDevice::EncapsulationMode [enumeration]
module.add_enum('EncapsulationMode', ['ILLEGAL', 'DIX', 'LLC'], outer_class=root_module['ns3::CsmaNetDevice'])
- ## Register a nested module for the namespace internal
+ ## Register a nested module for the namespace Config
- nested_module = module.add_cpp_namespace('internal')
- register_types_ns3_internal(nested_module)
+ nested_module = module.add_cpp_namespace('Config')
+ register_types_ns3_Config(nested_module)
## Register a nested module for the namespace TimeStepPrecision
@@ -28,10 +28,10 @@ def register_types(module):
register_types_ns3_TimeStepPrecision(nested_module)
- ## Register a nested module for the namespace Config
+ ## Register a nested module for the namespace internal
- nested_module = module.add_cpp_namespace('Config')
- register_types_ns3_Config(nested_module)
+ nested_module = module.add_cpp_namespace('internal')
+ register_types_ns3_internal(nested_module)
## Register a nested module for the namespace olsr
@@ -40,7 +40,7 @@ def register_types(module):
register_types_ns3_olsr(nested_module)
-def register_types_ns3_internal(module):
+def register_types_ns3_Config(module):
root_module = module.get_root()
@@ -48,7 +48,7 @@ def register_types_ns3_TimeStepPrecision(module):
root_module = module.get_root()
-def register_types_ns3_Config(module):
+def register_types_ns3_internal(module):
root_module = module.get_root()
@@ -338,13 +338,8 @@ def register_Ns3CsmaNetDevice_methods(root_module, cls):
'bool',
[],
is_const=True, is_virtual=True)
- ## csma-net-device.h: ns3::Address ns3::CsmaNetDevice::GetMulticast() const [member function]
+ ## csma-net-device.h: ns3::Address ns3::CsmaNetDevice::GetMulticast(ns3::Ipv4Address multicastGroup) const [member function]
cls.add_method('GetMulticast',
- 'ns3::Address',
- [],
- is_const=True, is_virtual=True)
- ## csma-net-device.h: ns3::Address ns3::CsmaNetDevice::MakeMulticastAddress(ns3::Ipv4Address multicastGroup) const [member function]
- cls.add_method('MakeMulticastAddress',
'ns3::Address',
[param('ns3::Ipv4Address', 'multicastGroup')],
is_const=True, is_virtual=True)
@@ -383,6 +378,11 @@ def register_Ns3CsmaNetDevice_methods(root_module, cls):
'void',
[param('ns3::Callback< bool, ns3::Ptr< ns3::NetDevice >, ns3::Ptr< ns3::Packet const >, unsigned short, ns3::Address const &, ns3::empty, ns3::empty >', 'cb')],
is_virtual=True)
+ ## csma-net-device.h: ns3::Address ns3::CsmaNetDevice::GetMulticast(ns3::Ipv6Address addr) const [member function]
+ cls.add_method('GetMulticast',
+ 'ns3::Address',
+ [param('ns3::Ipv6Address', 'addr')],
+ is_const=True, is_virtual=True)
## csma-net-device.h: void ns3::CsmaNetDevice::SetPromiscReceiveCallback(ns3::Callback, ns3::Ptr, unsigned short, ns3::Address const&, ns3::Address const&, ns3::NetDevice::PacketType> cb) [member function]
cls.add_method('SetPromiscReceiveCallback',
'void',
@@ -417,21 +417,21 @@ def register_Ns3CsmaNetDevice_methods(root_module, cls):
def register_functions(root_module):
module = root_module
- register_functions_ns3_internal(module.get_submodule('internal'), root_module)
- register_functions_ns3_TimeStepPrecision(module.get_submodule('TimeStepPrecision'), 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_internal(module, root_module):
- return
-
-def register_functions_ns3_TimeStepPrecision(module, 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
diff --git a/bindings/python/ns3_module_emu.py b/bindings/python/ns3_module_emu.py
new file mode 100644
index 000000000..695272767
--- /dev/null
+++ b/bindings/python/ns3_module_emu.py
@@ -0,0 +1,229 @@
+from pybindgen import Module, FileCodeSink, param, retval, cppclass
+
+def register_types(module):
+ root_module = module.get_root()
+
+ ## emu-net-device.h: ns3::EmuNetDevice [class]
+ module.add_class('EmuNetDevice', parent=root_module['ns3::NetDevice'])
+
+ ## Register a nested module for the namespace Config
+
+ nested_module = module.add_cpp_namespace('Config')
+ register_types_ns3_Config(nested_module)
+
+
+ ## Register a nested module for the namespace TimeStepPrecision
+
+ nested_module = module.add_cpp_namespace('TimeStepPrecision')
+ register_types_ns3_TimeStepPrecision(nested_module)
+
+
+ ## Register a nested module for the namespace 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_Ns3EmuNetDevice_methods(root_module, root_module['ns3::EmuNetDevice'])
+ return
+
+def register_Ns3EmuNetDevice_methods(root_module, cls):
+ ## emu-net-device.h: ns3::EmuNetDevice::EmuNetDevice(ns3::EmuNetDevice const & arg0) [copy constructor]
+ cls.add_constructor([param('ns3::EmuNetDevice const &', 'arg0')])
+ ## emu-net-device.h: static ns3::TypeId ns3::EmuNetDevice::GetTypeId() [member function]
+ cls.add_method('GetTypeId',
+ 'ns3::TypeId',
+ [],
+ is_static=True)
+ ## emu-net-device.h: ns3::EmuNetDevice::EmuNetDevice() [constructor]
+ cls.add_constructor([])
+ ## emu-net-device.h: void ns3::EmuNetDevice::SetDataRate(ns3::DataRate bps) [member function]
+ cls.add_method('SetDataRate',
+ 'void',
+ [param('ns3::DataRate', 'bps')])
+ ## emu-net-device.h: void ns3::EmuNetDevice::Start(ns3::Time tStart) [member function]
+ cls.add_method('Start',
+ 'void',
+ [param('ns3::Time', 'tStart')])
+ ## emu-net-device.h: void ns3::EmuNetDevice::Stop(ns3::Time tStop) [member function]
+ cls.add_method('Stop',
+ 'void',
+ [param('ns3::Time', 'tStop')])
+ ## emu-net-device.h: void ns3::EmuNetDevice::SetQueue(ns3::Ptr queue) [member function]
+ cls.add_method('SetQueue',
+ 'void',
+ [param('ns3::Ptr< ns3::Queue >', 'queue')])
+ ## emu-net-device.h: void ns3::EmuNetDevice::SetAddress(ns3::Mac48Address addr) [member function]
+ cls.add_method('SetAddress',
+ 'void',
+ [param('ns3::Mac48Address', 'addr')])
+ ## emu-net-device.h: void ns3::EmuNetDevice::SetName(std::string const name) [member function]
+ cls.add_method('SetName',
+ 'void',
+ [param('std::string const', 'name')],
+ is_virtual=True)
+ ## emu-net-device.h: std::string ns3::EmuNetDevice::GetName() const [member function]
+ cls.add_method('GetName',
+ 'std::string',
+ [],
+ is_const=True, is_virtual=True)
+ ## emu-net-device.h: void ns3::EmuNetDevice::SetIfIndex(uint32_t const index) [member function]
+ cls.add_method('SetIfIndex',
+ 'void',
+ [param('uint32_t const', 'index')],
+ is_virtual=True)
+ ## emu-net-device.h: uint32_t ns3::EmuNetDevice::GetIfIndex() const [member function]
+ cls.add_method('GetIfIndex',
+ 'uint32_t',
+ [],
+ is_const=True, is_virtual=True)
+ ## emu-net-device.h: ns3::Ptr ns3::EmuNetDevice::GetChannel() const [member function]
+ cls.add_method('GetChannel',
+ 'ns3::Ptr< ns3::Channel >',
+ [],
+ is_const=True, is_virtual=True)
+ ## emu-net-device.h: ns3::Address ns3::EmuNetDevice::GetAddress() const [member function]
+ cls.add_method('GetAddress',
+ 'ns3::Address',
+ [],
+ is_const=True, is_virtual=True)
+ ## emu-net-device.h: bool ns3::EmuNetDevice::SetMtu(uint16_t const mtu) [member function]
+ cls.add_method('SetMtu',
+ 'bool',
+ [param('uint16_t const', 'mtu')],
+ is_virtual=True)
+ ## emu-net-device.h: uint16_t ns3::EmuNetDevice::GetMtu() const [member function]
+ cls.add_method('GetMtu',
+ 'uint16_t',
+ [],
+ is_const=True, is_virtual=True)
+ ## emu-net-device.h: bool ns3::EmuNetDevice::IsLinkUp() const [member function]
+ cls.add_method('IsLinkUp',
+ 'bool',
+ [],
+ is_const=True, is_virtual=True)
+ ## emu-net-device.h: void ns3::EmuNetDevice::SetLinkChangeCallback(ns3::Callback callback) [member function]
+ cls.add_method('SetLinkChangeCallback',
+ 'void',
+ [param('ns3::Callback< void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'callback')],
+ is_virtual=True)
+ ## emu-net-device.h: bool ns3::EmuNetDevice::IsBroadcast() const [member function]
+ cls.add_method('IsBroadcast',
+ 'bool',
+ [],
+ is_const=True, is_virtual=True)
+ ## emu-net-device.h: ns3::Address ns3::EmuNetDevice::GetBroadcast() const [member function]
+ cls.add_method('GetBroadcast',
+ 'ns3::Address',
+ [],
+ is_const=True, is_virtual=True)
+ ## emu-net-device.h: bool ns3::EmuNetDevice::IsMulticast() const [member function]
+ cls.add_method('IsMulticast',
+ 'bool',
+ [],
+ is_const=True, is_virtual=True)
+ ## emu-net-device.h: ns3::Address ns3::EmuNetDevice::GetMulticast(ns3::Ipv4Address multicastGroup) const [member function]
+ cls.add_method('GetMulticast',
+ 'ns3::Address',
+ [param('ns3::Ipv4Address', 'multicastGroup')],
+ is_const=True, is_virtual=True)
+ ## emu-net-device.h: ns3::Address ns3::EmuNetDevice::GetMulticast(ns3::Ipv6Address addr) const [member function]
+ cls.add_method('GetMulticast',
+ 'ns3::Address',
+ [param('ns3::Ipv6Address', 'addr')],
+ is_const=True, is_virtual=True)
+ ## emu-net-device.h: bool ns3::EmuNetDevice::IsPointToPoint() const [member function]
+ cls.add_method('IsPointToPoint',
+ 'bool',
+ [],
+ is_const=True, is_virtual=True)
+ ## emu-net-device.h: bool ns3::EmuNetDevice::Send(ns3::Ptr packet, ns3::Address const & dest, uint16_t protocolNumber) [member function]
+ cls.add_method('Send',
+ 'bool',
+ [param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Address const &', 'dest'), param('uint16_t', 'protocolNumber')],
+ is_virtual=True)
+ ## emu-net-device.h: bool ns3::EmuNetDevice::SendFrom(ns3::Ptr packet, ns3::Address const & source, ns3::Address const & dest, uint16_t protocolNumber) [member function]
+ cls.add_method('SendFrom',
+ 'bool',
+ [param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Address const &', 'source'), param('ns3::Address const &', 'dest'), param('uint16_t', 'protocolNumber')],
+ is_virtual=True)
+ ## emu-net-device.h: ns3::Ptr ns3::EmuNetDevice::GetNode() const [member function]
+ cls.add_method('GetNode',
+ 'ns3::Ptr< ns3::Node >',
+ [],
+ is_const=True, is_virtual=True)
+ ## emu-net-device.h: void ns3::EmuNetDevice::SetNode(ns3::Ptr node) [member function]
+ cls.add_method('SetNode',
+ 'void',
+ [param('ns3::Ptr< ns3::Node >', 'node')],
+ is_virtual=True)
+ ## emu-net-device.h: bool ns3::EmuNetDevice::NeedsArp() const [member function]
+ cls.add_method('NeedsArp',
+ 'bool',
+ [],
+ is_const=True, is_virtual=True)
+ ## emu-net-device.h: void ns3::EmuNetDevice::SetReceiveCallback(ns3::Callback, ns3::Ptr, unsigned short, ns3::Address const&, 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 >', 'cb')],
+ is_virtual=True)
+ ## emu-net-device.h: void ns3::EmuNetDevice::SetPromiscReceiveCallback(ns3::Callback, ns3::Ptr, unsigned short, ns3::Address const&, ns3::Address const&, ns3::NetDevice::PacketType> 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 >', 'cb')],
+ is_virtual=True)
+ ## emu-net-device.h: bool ns3::EmuNetDevice::SupportsSendFrom() const [member function]
+ cls.add_method('SupportsSendFrom',
+ 'bool',
+ [],
+ is_const=True, is_virtual=True)
+ ## emu-net-device.h: void ns3::EmuNetDevice::DoDispose() [member function]
+ cls.add_method('DoDispose',
+ 'void',
+ [],
+ visibility='private', is_virtual=True)
+ return
+
+def register_functions(root_module):
+ module = root_module
+ register_functions_ns3_Config(module.get_submodule('Config'), root_module)
+ register_functions_ns3_TimeStepPrecision(module.get_submodule('TimeStepPrecision'), root_module)
+ register_functions_ns3_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
+
diff --git a/bindings/python/ns3_module_global_routing.py b/bindings/python/ns3_module_global_routing.py
index 67de0a1ab..8d435718d 100644
--- a/bindings/python/ns3_module_global_routing.py
+++ b/bindings/python/ns3_module_global_routing.py
@@ -18,10 +18,10 @@ def register_types(module):
## global-router-interface.h: ns3::GlobalRouter [class]
module.add_class('GlobalRouter', is_singleton=True, parent=root_module['ns3::Object'])
- ## Register a nested module for the namespace internal
+ ## Register a nested module for the namespace Config
- nested_module = module.add_cpp_namespace('internal')
- register_types_ns3_internal(nested_module)
+ nested_module = module.add_cpp_namespace('Config')
+ register_types_ns3_Config(nested_module)
## Register a nested module for the namespace TimeStepPrecision
@@ -30,10 +30,10 @@ def register_types(module):
register_types_ns3_TimeStepPrecision(nested_module)
- ## Register a nested module for the namespace Config
+ ## Register a nested module for the namespace internal
- nested_module = module.add_cpp_namespace('Config')
- register_types_ns3_Config(nested_module)
+ nested_module = module.add_cpp_namespace('internal')
+ register_types_ns3_internal(nested_module)
## Register a nested module for the namespace olsr
@@ -42,7 +42,7 @@ def register_types(module):
register_types_ns3_olsr(nested_module)
-def register_types_ns3_internal(module):
+def register_types_ns3_Config(module):
root_module = module.get_root()
@@ -50,7 +50,7 @@ def register_types_ns3_TimeStepPrecision(module):
root_module = module.get_root()
-def register_types_ns3_Config(module):
+def register_types_ns3_internal(module):
root_module = module.get_root()
@@ -260,21 +260,21 @@ def register_Ns3GlobalRouter_methods(root_module, cls):
def register_functions(root_module):
module = root_module
- register_functions_ns3_internal(module.get_submodule('internal'), root_module)
- register_functions_ns3_TimeStepPrecision(module.get_submodule('TimeStepPrecision'), 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_internal(module, root_module):
- return
-
-def register_functions_ns3_TimeStepPrecision(module, 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
diff --git a/bindings/python/ns3_module_helper.py b/bindings/python/ns3_module_helper.py
index 3497c187c..a9cb2518a 100644
--- a/bindings/python/ns3_module_helper.py
+++ b/bindings/python/ns3_module_helper.py
@@ -9,6 +9,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)
+ ## emu-helper.h: ns3::EmuHelper [class]
+ module.add_class('EmuHelper', allow_subclassing=False)
## internet-stack-helper.h: ns3::InternetStackHelper [class]
module.add_class('InternetStackHelper', allow_subclassing=False)
## ipv4-address-helper.h: ns3::Ipv4AddressHelper [class]
@@ -39,6 +41,8 @@ def register_types(module):
module.add_class('UdpEchoClientHelper', allow_subclassing=False)
## udp-echo-helper.h: ns3::UdpEchoServerHelper [class]
module.add_class('UdpEchoServerHelper', allow_subclassing=False)
+ ## v4ping-helper.h: ns3::V4PingHelper [class]
+ module.add_class('V4PingHelper', allow_subclassing=False)
## wifi-helper.h: ns3::WifiHelper [class]
module.add_class('WifiHelper', allow_subclassing=False)
## wifi-helper.h: ns3::WifiPhyHelper [class]
@@ -48,10 +52,10 @@ def register_types(module):
## yans-wifi-phy-helper.h: ns3::YansWifiPhyHelper [class]
module.add_class('YansWifiPhyHelper', allow_subclassing=False, parent=root_module['ns3::WifiPhyHelper'])
- ## Register a nested module for the namespace internal
+ ## Register a nested module for the namespace Config
- nested_module = module.add_cpp_namespace('internal')
- register_types_ns3_internal(nested_module)
+ nested_module = module.add_cpp_namespace('Config')
+ register_types_ns3_Config(nested_module)
## Register a nested module for the namespace TimeStepPrecision
@@ -60,10 +64,10 @@ def register_types(module):
register_types_ns3_TimeStepPrecision(nested_module)
- ## Register a nested module for the namespace Config
+ ## Register a nested module for the namespace internal
- nested_module = module.add_cpp_namespace('Config')
- register_types_ns3_Config(nested_module)
+ nested_module = module.add_cpp_namespace('internal')
+ register_types_ns3_internal(nested_module)
## Register a nested module for the namespace olsr
@@ -72,7 +76,7 @@ def register_types(module):
register_types_ns3_olsr(nested_module)
-def register_types_ns3_internal(module):
+def register_types_ns3_Config(module):
root_module = module.get_root()
@@ -80,7 +84,7 @@ def register_types_ns3_TimeStepPrecision(module):
root_module = module.get_root()
-def register_types_ns3_Config(module):
+def register_types_ns3_internal(module):
root_module = module.get_root()
@@ -92,6 +96,7 @@ def register_methods(root_module):
register_Ns3ApplicationContainer_methods(root_module, root_module['ns3::ApplicationContainer'])
register_Ns3BridgeHelper_methods(root_module, root_module['ns3::BridgeHelper'])
register_Ns3CsmaHelper_methods(root_module, root_module['ns3::CsmaHelper'])
+ register_Ns3EmuHelper_methods(root_module, root_module['ns3::EmuHelper'])
register_Ns3InternetStackHelper_methods(root_module, root_module['ns3::InternetStackHelper'])
register_Ns3Ipv4AddressHelper_methods(root_module, root_module['ns3::Ipv4AddressHelper'])
register_Ns3Ipv4InterfaceContainer_methods(root_module, root_module['ns3::Ipv4InterfaceContainer'])
@@ -107,6 +112,7 @@ def register_methods(root_module):
register_Ns3StaticMulticastRouteHelper_methods(root_module, root_module['ns3::StaticMulticastRouteHelper'])
register_Ns3UdpEchoClientHelper_methods(root_module, root_module['ns3::UdpEchoClientHelper'])
register_Ns3UdpEchoServerHelper_methods(root_module, root_module['ns3::UdpEchoServerHelper'])
+ register_Ns3V4PingHelper_methods(root_module, root_module['ns3::V4PingHelper'])
register_Ns3WifiHelper_methods(root_module, root_module['ns3::WifiHelper'])
register_Ns3WifiPhyHelper_methods(root_module, root_module['ns3::WifiPhyHelper'])
register_Ns3YansWifiChannelHelper_methods(root_module, root_module['ns3::YansWifiChannelHelper'])
@@ -118,6 +124,8 @@ def register_Ns3ApplicationContainer_methods(root_module, cls):
cls.add_constructor([param('ns3::ApplicationContainer const &', 'arg0')])
## application-container.h: ns3::ApplicationContainer::ApplicationContainer() [constructor]
cls.add_constructor([])
+ ## application-container.h: ns3::ApplicationContainer::ApplicationContainer(ns3::Ptr application) [constructor]
+ cls.add_constructor([param('ns3::Ptr< ns3::Application >', 'application')])
## application-container.h: __gnu_cxx::__normal_iterator*,std::vector, std::allocator > > > ns3::ApplicationContainer::Begin() const [member function]
cls.add_method('Begin',
'__gnu_cxx::__normal_iterator< ns3::Ptr< ns3::Application > const, std::vector< ns3::Ptr< ns3::Application > > >',
@@ -238,33 +246,126 @@ def register_Ns3CsmaHelper_methods(root_module, cls):
'void',
[param('std::ostream &', 'os')],
is_static=True)
- ## csma-helper.h: ns3::NetDeviceContainer ns3::CsmaHelper::Install(ns3::NodeContainer const & c) [member function]
+ ## csma-helper.h: ns3::NetDeviceContainer ns3::CsmaHelper::Install(ns3::Ptr node) const [member function]
cls.add_method('Install',
'ns3::NetDeviceContainer',
- [param('ns3::NodeContainer const &', 'c')])
- ## csma-helper.h: ns3::NetDeviceContainer ns3::CsmaHelper::Install(ns3::NodeContainer const & c, ns3::Ptr channel) [member function]
+ [param('ns3::Ptr< ns3::Node >', 'node')],
+ is_const=True)
+ ## csma-helper.h: ns3::NetDeviceContainer ns3::CsmaHelper::Install(ns3::Ptr node, ns3::Ptr channel) const [member function]
cls.add_method('Install',
'ns3::NetDeviceContainer',
- [param('ns3::NodeContainer const &', 'c'), param('ns3::Ptr< ns3::CsmaChannel >', 'channel')])
+ [param('ns3::Ptr< ns3::Node >', 'node'), param('ns3::Ptr< ns3::CsmaChannel >', 'channel')],
+ is_const=True)
+ ## csma-helper.h: ns3::NetDeviceContainer ns3::CsmaHelper::Install(ns3::NodeContainer const & c) const [member function]
+ cls.add_method('Install',
+ 'ns3::NetDeviceContainer',
+ [param('ns3::NodeContainer const &', 'c')],
+ is_const=True)
+ ## csma-helper.h: ns3::NetDeviceContainer ns3::CsmaHelper::Install(ns3::NodeContainer const & c, ns3::Ptr channel) const [member function]
+ cls.add_method('Install',
+ 'ns3::NetDeviceContainer',
+ [param('ns3::NodeContainer const &', 'c'), param('ns3::Ptr< ns3::CsmaChannel >', 'channel')],
+ is_const=True)
## csma-helper.h: 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')])
return
+def register_Ns3EmuHelper_methods(root_module, cls):
+ ## emu-helper.h: ns3::EmuHelper::EmuHelper(ns3::EmuHelper const & arg0) [copy constructor]
+ cls.add_constructor([param('ns3::EmuHelper const &', 'arg0')])
+ ## emu-helper.h: ns3::EmuHelper::EmuHelper() [constructor]
+ cls.add_constructor([])
+ ## emu-helper.h: void ns3::EmuHelper::SetQueue(std::string type, std::string n1="", ns3::AttributeValue const & v1=ns3::EmptyAttributeValue(), std::string n2="", ns3::AttributeValue const & v2=ns3::EmptyAttributeValue(), std::string n3="", ns3::AttributeValue const & v3=ns3::EmptyAttributeValue(), std::string n4="", ns3::AttributeValue const & v4=ns3::EmptyAttributeValue()) [member function]
+ cls.add_method('SetQueue',
+ 'void',
+ [param('std::string', 'type'), param('std::string', 'n1', default_value='""'), param('ns3::AttributeValue const &', 'v1', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n2', default_value='""'), param('ns3::AttributeValue const &', 'v2', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n3', default_value='""'), param('ns3::AttributeValue const &', 'v3', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n4', default_value='""'), param('ns3::AttributeValue const &', 'v4', default_value='ns3::EmptyAttributeValue()')])
+ ## emu-helper.h: void ns3::EmuHelper::SetAttribute(std::string n1, ns3::AttributeValue const & v1) [member function]
+ cls.add_method('SetAttribute',
+ 'void',
+ [param('std::string', 'n1'), param('ns3::AttributeValue const &', 'v1')])
+ ## emu-helper.h: static void ns3::EmuHelper::EnablePcap(std::string filename, uint32_t nodeid, uint32_t deviceid) [member function]
+ cls.add_method('EnablePcap',
+ 'void',
+ [param('std::string', 'filename'), param('uint32_t', 'nodeid'), param('uint32_t', 'deviceid')],
+ is_static=True)
+ ## emu-helper.h: static void ns3::EmuHelper::EnablePcap(std::string filename, ns3::NetDeviceContainer d) [member function]
+ cls.add_method('EnablePcap',
+ 'void',
+ [param('std::string', 'filename'), param('ns3::NetDeviceContainer', 'd')],
+ is_static=True)
+ ## emu-helper.h: static void ns3::EmuHelper::EnablePcap(std::string filename, ns3::NodeContainer n) [member function]
+ cls.add_method('EnablePcap',
+ 'void',
+ [param('std::string', 'filename'), param('ns3::NodeContainer', 'n')],
+ is_static=True)
+ ## emu-helper.h: static void ns3::EmuHelper::EnablePcapAll(std::string filename) [member function]
+ cls.add_method('EnablePcapAll',
+ 'void',
+ [param('std::string', 'filename')],
+ is_static=True)
+ ## emu-helper.h: static void ns3::EmuHelper::EnableAscii(std::ostream & os, uint32_t nodeid, uint32_t deviceid) [member function]
+ cls.add_method('EnableAscii',
+ 'void',
+ [param('std::ostream &', 'os'), param('uint32_t', 'nodeid'), param('uint32_t', 'deviceid')],
+ is_static=True)
+ ## emu-helper.h: static void ns3::EmuHelper::EnableAscii(std::ostream & os, ns3::NetDeviceContainer d) [member function]
+ cls.add_method('EnableAscii',
+ 'void',
+ [param('std::ostream &', 'os'), param('ns3::NetDeviceContainer', 'd')],
+ is_static=True)
+ ## emu-helper.h: static void ns3::EmuHelper::EnableAscii(std::ostream & os, ns3::NodeContainer n) [member function]
+ cls.add_method('EnableAscii',
+ 'void',
+ [param('std::ostream &', 'os'), param('ns3::NodeContainer', 'n')],
+ is_static=True)
+ ## emu-helper.h: static void ns3::EmuHelper::EnableAsciiAll(std::ostream & os) [member function]
+ cls.add_method('EnableAsciiAll',
+ 'void',
+ [param('std::ostream &', 'os')],
+ is_static=True)
+ ## emu-helper.h: ns3::NetDeviceContainer ns3::EmuHelper::Install(ns3::Ptr node) const [member function]
+ cls.add_method('Install',
+ 'ns3::NetDeviceContainer',
+ [param('ns3::Ptr< ns3::Node >', 'node')],
+ is_const=True)
+ ## emu-helper.h: ns3::NetDeviceContainer ns3::EmuHelper::Install(ns3::NodeContainer const & c) const [member function]
+ cls.add_method('Install',
+ 'ns3::NetDeviceContainer',
+ [param('ns3::NodeContainer const &', 'c')],
+ is_const=True)
+ return
+
def register_Ns3InternetStackHelper_methods(root_module, cls):
## internet-stack-helper.h: ns3::InternetStackHelper::InternetStackHelper(ns3::InternetStackHelper const & arg0) [copy constructor]
cls.add_constructor([param('ns3::InternetStackHelper const &', 'arg0')])
## internet-stack-helper.h: ns3::InternetStackHelper::InternetStackHelper() [constructor]
cls.add_constructor([])
- ## internet-stack-helper.h: void ns3::InternetStackHelper::Install(ns3::NodeContainer c) [member function]
+ ## internet-stack-helper.h: void ns3::InternetStackHelper::Install(ns3::Ptr node) const [member function]
cls.add_method('Install',
'void',
- [param('ns3::NodeContainer', 'c')])
+ [param('ns3::Ptr< ns3::Node >', 'node')],
+ is_const=True)
+ ## internet-stack-helper.h: void ns3::InternetStackHelper::Install(ns3::NodeContainer c) const [member function]
+ cls.add_method('Install',
+ 'void',
+ [param('ns3::NodeContainer', 'c')],
+ is_const=True)
## internet-stack-helper.h: void ns3::InternetStackHelper::SetNscStack(std::string soname) [member function]
cls.add_method('SetNscStack',
'void',
[param('std::string', 'soname')])
+ ## internet-stack-helper.h: static void ns3::InternetStackHelper::EnableAscii(std::ostream & os, ns3::NodeContainer n) [member function]
+ cls.add_method('EnableAscii',
+ 'void',
+ [param('std::ostream &', 'os'), param('ns3::NodeContainer', 'n')],
+ is_static=True)
+ ## internet-stack-helper.h: static void ns3::InternetStackHelper::EnableAsciiAll(std::ostream & os) [member function]
+ cls.add_method('EnableAsciiAll',
+ 'void',
+ [param('std::ostream &', 'os')],
+ is_static=True)
## internet-stack-helper.h: static void ns3::InternetStackHelper::EnablePcapAll(std::string filename) [member function]
cls.add_method('EnablePcapAll',
'void',
@@ -354,10 +455,16 @@ def register_Ns3MobilityHelper_methods(root_module, cls):
'std::string',
[],
is_const=True)
- ## mobility-helper.h: void ns3::MobilityHelper::Install(ns3::NodeContainer container) [member function]
+ ## mobility-helper.h: void ns3::MobilityHelper::Install(ns3::Ptr node) const [member function]
cls.add_method('Install',
'void',
- [param('ns3::NodeContainer', 'container')])
+ [param('ns3::Ptr< ns3::Node >', 'node')],
+ is_const=True)
+ ## mobility-helper.h: void ns3::MobilityHelper::Install(ns3::NodeContainer container) const [member function]
+ cls.add_method('Install',
+ 'void',
+ [param('ns3::NodeContainer', 'container')],
+ is_const=True)
## mobility-helper.h: void ns3::MobilityHelper::InstallAll() [member function]
cls.add_method('InstallAll',
'void',
@@ -514,10 +621,16 @@ def register_Ns3OnOffHelper_methods(root_module, cls):
cls.add_method('SetAttribute',
'void',
[param('std::string', 'name'), param('ns3::AttributeValue const &', 'value')])
- ## on-off-helper.h: ns3::ApplicationContainer ns3::OnOffHelper::Install(ns3::NodeContainer c) [member function]
+ ## on-off-helper.h: ns3::ApplicationContainer ns3::OnOffHelper::Install(ns3::NodeContainer c) const [member function]
cls.add_method('Install',
'ns3::ApplicationContainer',
- [param('ns3::NodeContainer', 'c')])
+ [param('ns3::NodeContainer', 'c')],
+ is_const=True)
+ ## on-off-helper.h: ns3::ApplicationContainer ns3::OnOffHelper::Install(ns3::Ptr node) const [member function]
+ cls.add_method('Install',
+ 'ns3::ApplicationContainer',
+ [param('ns3::Ptr< ns3::Node >', 'node')],
+ is_const=True)
return
def register_Ns3PacketSinkHelper_methods(root_module, cls):
@@ -529,10 +642,16 @@ def register_Ns3PacketSinkHelper_methods(root_module, cls):
cls.add_method('SetAttribute',
'void',
[param('std::string', 'name'), param('ns3::AttributeValue const &', 'value')])
- ## packet-sink-helper.h: ns3::ApplicationContainer ns3::PacketSinkHelper::Install(ns3::NodeContainer c) [member function]
+ ## packet-sink-helper.h: ns3::ApplicationContainer ns3::PacketSinkHelper::Install(ns3::NodeContainer c) const [member function]
cls.add_method('Install',
'ns3::ApplicationContainer',
- [param('ns3::NodeContainer', 'c')])
+ [param('ns3::NodeContainer', 'c')],
+ is_const=True)
+ ## packet-sink-helper.h: ns3::ApplicationContainer ns3::PacketSinkHelper::Install(ns3::Ptr node) const [member function]
+ cls.add_method('Install',
+ 'ns3::ApplicationContainer',
+ [param('ns3::Ptr< ns3::Node >', 'node')],
+ is_const=True)
return
def register_Ns3PacketSocketHelper_methods(root_module, cls):
@@ -540,10 +659,16 @@ def register_Ns3PacketSocketHelper_methods(root_module, cls):
cls.add_constructor([param('ns3::PacketSocketHelper const &', 'arg0')])
## packet-socket-helper.h: ns3::PacketSocketHelper::PacketSocketHelper() [constructor]
cls.add_constructor([])
- ## packet-socket-helper.h: void ns3::PacketSocketHelper::Install(ns3::NodeContainer c) [member function]
+ ## packet-socket-helper.h: void ns3::PacketSocketHelper::Install(ns3::Ptr node) const [member function]
cls.add_method('Install',
'void',
- [param('ns3::NodeContainer', 'c')])
+ [param('ns3::Ptr< ns3::Node >', 'node')],
+ is_const=True)
+ ## packet-socket-helper.h: void ns3::PacketSocketHelper::Install(ns3::NodeContainer c) const [member function]
+ cls.add_method('Install',
+ 'void',
+ [param('ns3::NodeContainer', 'c')],
+ is_const=True)
return
def register_Ns3PointToPointHelper_methods(root_module, cls):
@@ -655,10 +780,16 @@ def register_Ns3UdpEchoClientHelper_methods(root_module, cls):
cls.add_method('SetAttribute',
'void',
[param('std::string', 'name'), param('ns3::AttributeValue const &', 'value')])
- ## udp-echo-helper.h: ns3::ApplicationContainer ns3::UdpEchoClientHelper::Install(ns3::NodeContainer c) [member function]
+ ## udp-echo-helper.h: ns3::ApplicationContainer ns3::UdpEchoClientHelper::Install(ns3::Ptr node) const [member function]
cls.add_method('Install',
'ns3::ApplicationContainer',
- [param('ns3::NodeContainer', 'c')])
+ [param('ns3::Ptr< ns3::Node >', 'node')],
+ is_const=True)
+ ## udp-echo-helper.h: ns3::ApplicationContainer ns3::UdpEchoClientHelper::Install(ns3::NodeContainer c) const [member function]
+ cls.add_method('Install',
+ 'ns3::ApplicationContainer',
+ [param('ns3::NodeContainer', 'c')],
+ is_const=True)
return
def register_Ns3UdpEchoServerHelper_methods(root_module, cls):
@@ -670,10 +801,37 @@ def register_Ns3UdpEchoServerHelper_methods(root_module, cls):
cls.add_method('SetAttribute',
'void',
[param('std::string', 'name'), param('ns3::AttributeValue const &', 'value')])
- ## udp-echo-helper.h: ns3::ApplicationContainer ns3::UdpEchoServerHelper::Install(ns3::NodeContainer c) [member function]
+ ## udp-echo-helper.h: ns3::ApplicationContainer ns3::UdpEchoServerHelper::Install(ns3::Ptr node) const [member function]
cls.add_method('Install',
'ns3::ApplicationContainer',
- [param('ns3::NodeContainer', 'c')])
+ [param('ns3::Ptr< ns3::Node >', 'node')],
+ is_const=True)
+ ## udp-echo-helper.h: ns3::ApplicationContainer ns3::UdpEchoServerHelper::Install(ns3::NodeContainer c) const [member function]
+ cls.add_method('Install',
+ 'ns3::ApplicationContainer',
+ [param('ns3::NodeContainer', 'c')],
+ is_const=True)
+ return
+
+def register_Ns3V4PingHelper_methods(root_module, cls):
+ ## v4ping-helper.h: ns3::V4PingHelper::V4PingHelper(ns3::V4PingHelper const & arg0) [copy constructor]
+ cls.add_constructor([param('ns3::V4PingHelper const &', 'arg0')])
+ ## v4ping-helper.h: ns3::V4PingHelper::V4PingHelper(ns3::Ipv4Address remote) [constructor]
+ cls.add_constructor([param('ns3::Ipv4Address', 'remote')])
+ ## v4ping-helper.h: void ns3::V4PingHelper::SetAttribute(std::string name, ns3::AttributeValue const & value) [member function]
+ cls.add_method('SetAttribute',
+ 'void',
+ [param('std::string', 'name'), param('ns3::AttributeValue const &', 'value')])
+ ## v4ping-helper.h: ns3::ApplicationContainer ns3::V4PingHelper::Install(ns3::NodeContainer nodes) const [member function]
+ cls.add_method('Install',
+ 'ns3::ApplicationContainer',
+ [param('ns3::NodeContainer', 'nodes')],
+ is_const=True)
+ ## v4ping-helper.h: ns3::ApplicationContainer ns3::V4PingHelper::Install(ns3::Ptr node) const [member function]
+ cls.add_method('Install',
+ 'ns3::ApplicationContainer',
+ [param('ns3::Ptr< ns3::Node >', 'node')],
+ is_const=True)
return
def register_Ns3WifiHelper_methods(root_module, cls):
@@ -809,21 +967,21 @@ def register_Ns3YansWifiPhyHelper_methods(root_module, cls):
def register_functions(root_module):
module = root_module
- register_functions_ns3_internal(module.get_submodule('internal'), root_module)
- register_functions_ns3_TimeStepPrecision(module.get_submodule('TimeStepPrecision'), 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_internal(module, root_module):
- return
-
-def register_functions_ns3_TimeStepPrecision(module, 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
diff --git a/bindings/python/ns3_module_internet_stack.py b/bindings/python/ns3_module_internet_stack.py
index 439307348..303d893af 100644
--- a/bindings/python/ns3_module_internet_stack.py
+++ b/bindings/python/ns3_module_internet_stack.py
@@ -3,6 +3,20 @@ from pybindgen import Module, FileCodeSink, param, retval, cppclass
def register_types(module):
root_module = module.get_root()
+ ## icmpv4.h: ns3::Icmpv4DestinationUnreachable [class]
+ module.add_class('Icmpv4DestinationUnreachable', parent=root_module['ns3::Header'])
+ ## icmpv4.h: ns3::Icmpv4DestinationUnreachable [enumeration]
+ module.add_enum('', ['NET_UNREACHABLE', 'HOST_UNREACHABLE', 'PROTOCOL_UNREACHABLE', 'PORT_UNREACHABLE', 'FRAG_NEEDED', 'SOURCE_ROUTE_FAILED'], outer_class=root_module['ns3::Icmpv4DestinationUnreachable'])
+ ## icmpv4.h: ns3::Icmpv4Echo [class]
+ module.add_class('Icmpv4Echo', parent=root_module['ns3::Header'])
+ ## icmpv4.h: ns3::Icmpv4Header [class]
+ module.add_class('Icmpv4Header', parent=root_module['ns3::Header'])
+ ## icmpv4.h: ns3::Icmpv4Header [enumeration]
+ module.add_enum('', ['ECHO_REPLY', 'DEST_UNREACH', 'ECHO', 'TIME_EXCEEDED'], outer_class=root_module['ns3::Icmpv4Header'])
+ ## icmpv4.h: ns3::Icmpv4TimeExceeded [class]
+ module.add_class('Icmpv4TimeExceeded', parent=root_module['ns3::Header'])
+ ## icmpv4.h: ns3::Icmpv4TimeExceeded [enumeration]
+ module.add_enum('', ['TIME_TO_LIVE', 'FRAGMENT_REASSEMBLY'], outer_class=root_module['ns3::Icmpv4TimeExceeded'])
## tcp-header.h: ns3::TcpHeader [class]
module.add_class('TcpHeader', parent=root_module['ns3::Header'])
## tcp-header.h: ns3::TcpHeader::Flags_t [enumeration]
@@ -16,10 +30,10 @@ def register_types(module):
## ipv4-static-routing.h: ns3::Ipv4StaticRouting [class]
module.add_class('Ipv4StaticRouting', parent=root_module['ns3::Ipv4RoutingProtocol'])
- ## Register a nested module for the namespace internal
+ ## Register a nested module for the namespace Config
- nested_module = module.add_cpp_namespace('internal')
- register_types_ns3_internal(nested_module)
+ nested_module = module.add_cpp_namespace('Config')
+ register_types_ns3_Config(nested_module)
## Register a nested module for the namespace TimeStepPrecision
@@ -28,10 +42,10 @@ def register_types(module):
register_types_ns3_TimeStepPrecision(nested_module)
- ## Register a nested module for the namespace Config
+ ## Register a nested module for the namespace internal
- nested_module = module.add_cpp_namespace('Config')
- register_types_ns3_Config(nested_module)
+ nested_module = module.add_cpp_namespace('internal')
+ register_types_ns3_internal(nested_module)
## Register a nested module for the namespace olsr
@@ -40,7 +54,7 @@ def register_types(module):
register_types_ns3_olsr(nested_module)
-def register_types_ns3_internal(module):
+def register_types_ns3_Config(module):
root_module = module.get_root()
@@ -48,7 +62,7 @@ def register_types_ns3_TimeStepPrecision(module):
root_module = module.get_root()
-def register_types_ns3_Config(module):
+def register_types_ns3_internal(module):
root_module = module.get_root()
@@ -57,6 +71,10 @@ def register_types_ns3_olsr(module):
def register_methods(root_module):
+ register_Ns3Icmpv4DestinationUnreachable_methods(root_module, root_module['ns3::Icmpv4DestinationUnreachable'])
+ register_Ns3Icmpv4Echo_methods(root_module, root_module['ns3::Icmpv4Echo'])
+ register_Ns3Icmpv4Header_methods(root_module, root_module['ns3::Icmpv4Header'])
+ register_Ns3Icmpv4TimeExceeded_methods(root_module, root_module['ns3::Icmpv4TimeExceeded'])
register_Ns3TcpHeader_methods(root_module, root_module['ns3::TcpHeader'])
register_Ns3UdpHeader_methods(root_module, root_module['ns3::UdpHeader'])
register_Ns3Ipv4Interface_methods(root_module, root_module['ns3::Ipv4Interface'])
@@ -64,6 +82,248 @@ def register_methods(root_module):
register_Ns3Ipv4StaticRouting_methods(root_module, root_module['ns3::Ipv4StaticRouting'])
return
+def register_Ns3Icmpv4DestinationUnreachable_methods(root_module, cls):
+ ## icmpv4.h: ns3::Icmpv4DestinationUnreachable::Icmpv4DestinationUnreachable(ns3::Icmpv4DestinationUnreachable const & arg0) [copy constructor]
+ cls.add_constructor([param('ns3::Icmpv4DestinationUnreachable const &', 'arg0')])
+ ## icmpv4.h: static ns3::TypeId ns3::Icmpv4DestinationUnreachable::GetTypeId() [member function]
+ cls.add_method('GetTypeId',
+ 'ns3::TypeId',
+ [],
+ is_static=True)
+ ## icmpv4.h: ns3::Icmpv4DestinationUnreachable::Icmpv4DestinationUnreachable() [constructor]
+ cls.add_constructor([])
+ ## icmpv4.h: void ns3::Icmpv4DestinationUnreachable::SetNextHopMtu(uint16_t mtu) [member function]
+ cls.add_method('SetNextHopMtu',
+ 'void',
+ [param('uint16_t', 'mtu')])
+ ## icmpv4.h: uint16_t ns3::Icmpv4DestinationUnreachable::GetNextHopMtu() const [member function]
+ cls.add_method('GetNextHopMtu',
+ 'uint16_t',
+ [],
+ is_const=True)
+ ## icmpv4.h: void ns3::Icmpv4DestinationUnreachable::SetData(ns3::Ptr data) [member function]
+ cls.add_method('SetData',
+ 'void',
+ [param('ns3::Ptr< ns3::Packet const >', 'data')])
+ ## icmpv4.h: void ns3::Icmpv4DestinationUnreachable::SetHeader(ns3::Ipv4Header header) [member function]
+ cls.add_method('SetHeader',
+ 'void',
+ [param('ns3::Ipv4Header', 'header')])
+ ## icmpv4.h: void ns3::Icmpv4DestinationUnreachable::GetData(uint8_t * payload) const [member function]
+ cls.add_method('GetData',
+ 'void',
+ [param('uint8_t *', 'payload')],
+ is_const=True)
+ ## icmpv4.h: ns3::Ipv4Header ns3::Icmpv4DestinationUnreachable::GetHeader() const [member function]
+ cls.add_method('GetHeader',
+ 'ns3::Ipv4Header',
+ [],
+ is_const=True)
+ ## icmpv4.h: ns3::TypeId ns3::Icmpv4DestinationUnreachable::GetInstanceTypeId() const [member function]
+ cls.add_method('GetInstanceTypeId',
+ 'ns3::TypeId',
+ [],
+ is_const=True, visibility='private', is_virtual=True)
+ ## icmpv4.h: uint32_t ns3::Icmpv4DestinationUnreachable::GetSerializedSize() const [member function]
+ cls.add_method('GetSerializedSize',
+ 'uint32_t',
+ [],
+ is_const=True, visibility='private', is_virtual=True)
+ ## icmpv4.h: void ns3::Icmpv4DestinationUnreachable::Serialize(ns3::Buffer::Iterator start) const [member function]
+ cls.add_method('Serialize',
+ 'void',
+ [param('ns3::Buffer::Iterator', 'start')],
+ is_const=True, visibility='private', is_virtual=True)
+ ## icmpv4.h: uint32_t ns3::Icmpv4DestinationUnreachable::Deserialize(ns3::Buffer::Iterator start) [member function]
+ cls.add_method('Deserialize',
+ 'uint32_t',
+ [param('ns3::Buffer::Iterator', 'start')],
+ visibility='private', is_virtual=True)
+ ## icmpv4.h: void ns3::Icmpv4DestinationUnreachable::Print(std::ostream & os) const [member function]
+ cls.add_method('Print',
+ 'void',
+ [param('std::ostream &', 'os')],
+ is_const=True, visibility='private', is_virtual=True)
+ return
+
+def register_Ns3Icmpv4Echo_methods(root_module, cls):
+ ## icmpv4.h: ns3::Icmpv4Echo::Icmpv4Echo(ns3::Icmpv4Echo const & arg0) [copy constructor]
+ cls.add_constructor([param('ns3::Icmpv4Echo const &', 'arg0')])
+ ## icmpv4.h: void ns3::Icmpv4Echo::SetIdentifier(uint16_t id) [member function]
+ cls.add_method('SetIdentifier',
+ 'void',
+ [param('uint16_t', 'id')])
+ ## icmpv4.h: void ns3::Icmpv4Echo::SetSequenceNumber(uint16_t seq) [member function]
+ cls.add_method('SetSequenceNumber',
+ 'void',
+ [param('uint16_t', 'seq')])
+ ## icmpv4.h: void ns3::Icmpv4Echo::SetData(ns3::Ptr data) [member function]
+ cls.add_method('SetData',
+ 'void',
+ [param('ns3::Ptr< ns3::Packet const >', 'data')])
+ ## icmpv4.h: uint16_t ns3::Icmpv4Echo::GetIdentifier() const [member function]
+ cls.add_method('GetIdentifier',
+ 'uint16_t',
+ [],
+ is_const=True)
+ ## icmpv4.h: uint16_t ns3::Icmpv4Echo::GetSequenceNumber() const [member function]
+ cls.add_method('GetSequenceNumber',
+ 'uint16_t',
+ [],
+ is_const=True)
+ ## icmpv4.h: ns3::Ptr ns3::Icmpv4Echo::GetData() const [member function]
+ cls.add_method('GetData',
+ 'ns3::Ptr< ns3::Packet const >',
+ [],
+ is_const=True)
+ ## icmpv4.h: static ns3::TypeId ns3::Icmpv4Echo::GetTypeId() [member function]
+ cls.add_method('GetTypeId',
+ 'ns3::TypeId',
+ [],
+ is_static=True)
+ ## icmpv4.h: ns3::Icmpv4Echo::Icmpv4Echo() [constructor]
+ cls.add_constructor([])
+ ## icmpv4.h: ns3::TypeId ns3::Icmpv4Echo::GetInstanceTypeId() const [member function]
+ cls.add_method('GetInstanceTypeId',
+ 'ns3::TypeId',
+ [],
+ is_const=True, is_virtual=True)
+ ## icmpv4.h: uint32_t ns3::Icmpv4Echo::GetSerializedSize() const [member function]
+ cls.add_method('GetSerializedSize',
+ 'uint32_t',
+ [],
+ is_const=True, is_virtual=True)
+ ## icmpv4.h: void ns3::Icmpv4Echo::Serialize(ns3::Buffer::Iterator start) const [member function]
+ cls.add_method('Serialize',
+ 'void',
+ [param('ns3::Buffer::Iterator', 'start')],
+ is_const=True, is_virtual=True)
+ ## icmpv4.h: uint32_t ns3::Icmpv4Echo::Deserialize(ns3::Buffer::Iterator start) [member function]
+ cls.add_method('Deserialize',
+ 'uint32_t',
+ [param('ns3::Buffer::Iterator', 'start')],
+ is_virtual=True)
+ ## icmpv4.h: void ns3::Icmpv4Echo::Print(std::ostream & os) const [member function]
+ cls.add_method('Print',
+ 'void',
+ [param('std::ostream &', 'os')],
+ is_const=True, is_virtual=True)
+ return
+
+def register_Ns3Icmpv4Header_methods(root_module, cls):
+ ## icmpv4.h: ns3::Icmpv4Header::Icmpv4Header(ns3::Icmpv4Header const & arg0) [copy constructor]
+ cls.add_constructor([param('ns3::Icmpv4Header const &', 'arg0')])
+ ## icmpv4.h: void ns3::Icmpv4Header::EnableChecksum() [member function]
+ cls.add_method('EnableChecksum',
+ 'void',
+ [])
+ ## icmpv4.h: void ns3::Icmpv4Header::SetType(uint8_t type) [member function]
+ cls.add_method('SetType',
+ 'void',
+ [param('uint8_t', 'type')])
+ ## icmpv4.h: void ns3::Icmpv4Header::SetCode(uint8_t code) [member function]
+ cls.add_method('SetCode',
+ 'void',
+ [param('uint8_t', 'code')])
+ ## icmpv4.h: uint8_t ns3::Icmpv4Header::GetType() const [member function]
+ cls.add_method('GetType',
+ 'uint8_t',
+ [],
+ is_const=True)
+ ## icmpv4.h: uint8_t ns3::Icmpv4Header::GetCode() const [member function]
+ cls.add_method('GetCode',
+ 'uint8_t',
+ [],
+ is_const=True)
+ ## icmpv4.h: static ns3::TypeId ns3::Icmpv4Header::GetTypeId() [member function]
+ cls.add_method('GetTypeId',
+ 'ns3::TypeId',
+ [],
+ is_static=True)
+ ## icmpv4.h: ns3::Icmpv4Header::Icmpv4Header() [constructor]
+ cls.add_constructor([])
+ ## icmpv4.h: ns3::TypeId ns3::Icmpv4Header::GetInstanceTypeId() const [member function]
+ cls.add_method('GetInstanceTypeId',
+ 'ns3::TypeId',
+ [],
+ is_const=True, is_virtual=True)
+ ## icmpv4.h: uint32_t ns3::Icmpv4Header::GetSerializedSize() const [member function]
+ cls.add_method('GetSerializedSize',
+ 'uint32_t',
+ [],
+ is_const=True, is_virtual=True)
+ ## icmpv4.h: void ns3::Icmpv4Header::Serialize(ns3::Buffer::Iterator start) const [member function]
+ cls.add_method('Serialize',
+ 'void',
+ [param('ns3::Buffer::Iterator', 'start')],
+ is_const=True, is_virtual=True)
+ ## icmpv4.h: uint32_t ns3::Icmpv4Header::Deserialize(ns3::Buffer::Iterator start) [member function]
+ cls.add_method('Deserialize',
+ 'uint32_t',
+ [param('ns3::Buffer::Iterator', 'start')],
+ is_virtual=True)
+ ## icmpv4.h: void ns3::Icmpv4Header::Print(std::ostream & os) const [member function]
+ cls.add_method('Print',
+ 'void',
+ [param('std::ostream &', 'os')],
+ is_const=True, is_virtual=True)
+ return
+
+def register_Ns3Icmpv4TimeExceeded_methods(root_module, cls):
+ ## icmpv4.h: ns3::Icmpv4TimeExceeded::Icmpv4TimeExceeded(ns3::Icmpv4TimeExceeded const & arg0) [copy constructor]
+ cls.add_constructor([param('ns3::Icmpv4TimeExceeded const &', 'arg0')])
+ ## icmpv4.h: void ns3::Icmpv4TimeExceeded::SetData(ns3::Ptr data) [member function]
+ cls.add_method('SetData',
+ 'void',
+ [param('ns3::Ptr< ns3::Packet const >', 'data')])
+ ## icmpv4.h: void ns3::Icmpv4TimeExceeded::SetHeader(ns3::Ipv4Header header) [member function]
+ cls.add_method('SetHeader',
+ 'void',
+ [param('ns3::Ipv4Header', 'header')])
+ ## icmpv4.h: void ns3::Icmpv4TimeExceeded::GetData(uint8_t * payload) const [member function]
+ cls.add_method('GetData',
+ 'void',
+ [param('uint8_t *', 'payload')],
+ is_const=True)
+ ## icmpv4.h: ns3::Ipv4Header ns3::Icmpv4TimeExceeded::GetHeader() const [member function]
+ cls.add_method('GetHeader',
+ 'ns3::Ipv4Header',
+ [],
+ is_const=True)
+ ## icmpv4.h: static ns3::TypeId ns3::Icmpv4TimeExceeded::GetTypeId() [member function]
+ cls.add_method('GetTypeId',
+ 'ns3::TypeId',
+ [],
+ is_static=True)
+ ## icmpv4.h: ns3::Icmpv4TimeExceeded::Icmpv4TimeExceeded() [constructor]
+ cls.add_constructor([])
+ ## icmpv4.h: ns3::TypeId ns3::Icmpv4TimeExceeded::GetInstanceTypeId() const [member function]
+ cls.add_method('GetInstanceTypeId',
+ 'ns3::TypeId',
+ [],
+ is_const=True, is_virtual=True)
+ ## icmpv4.h: uint32_t ns3::Icmpv4TimeExceeded::GetSerializedSize() const [member function]
+ cls.add_method('GetSerializedSize',
+ 'uint32_t',
+ [],
+ is_const=True, is_virtual=True)
+ ## icmpv4.h: void ns3::Icmpv4TimeExceeded::Serialize(ns3::Buffer::Iterator start) const [member function]
+ cls.add_method('Serialize',
+ 'void',
+ [param('ns3::Buffer::Iterator', 'start')],
+ is_const=True, is_virtual=True)
+ ## icmpv4.h: uint32_t ns3::Icmpv4TimeExceeded::Deserialize(ns3::Buffer::Iterator start) [member function]
+ cls.add_method('Deserialize',
+ 'uint32_t',
+ [param('ns3::Buffer::Iterator', 'start')],
+ is_virtual=True)
+ ## icmpv4.h: void ns3::Icmpv4TimeExceeded::Print(std::ostream & os) const [member function]
+ cls.add_method('Print',
+ 'void',
+ [param('std::ostream &', 'os')],
+ is_const=True, is_virtual=True)
+ return
+
def register_Ns3TcpHeader_methods(root_module, cls):
## tcp-header.h: ns3::TcpHeader::TcpHeader(ns3::TcpHeader const & arg0) [copy constructor]
cls.add_constructor([param('ns3::TcpHeader const &', 'arg0')])
@@ -354,6 +614,14 @@ def register_Ns3Ipv4L3Protocol_methods(root_module, cls):
cls.add_method('SetNode',
'void',
[param('ns3::Ptr< ns3::Node >', 'node')])
+ ## ipv4-l3-protocol.h: ns3::Ptr ns3::Ipv4L3Protocol::CreateRawSocket() [member function]
+ cls.add_method('CreateRawSocket',
+ 'ns3::Ptr< ns3::Socket >',
+ [])
+ ## ipv4-l3-protocol.h: void ns3::Ipv4L3Protocol::DeleteRawSocket(ns3::Ptr socket) [member function]
+ cls.add_method('DeleteRawSocket',
+ 'void',
+ [param('ns3::Ptr< ns3::Socket >', 'socket')])
## ipv4-l3-protocol.h: void ns3::Ipv4L3Protocol::Insert(ns3::Ptr protocol) [member function]
cls.add_method('Insert',
'void',
@@ -642,21 +910,21 @@ def register_functions(root_module):
module.add_function('AddNscInternetStack',
'void',
[param('ns3::Ptr< ns3::Node >', 'node'), param('std::string const &', 'soname')])
- register_functions_ns3_internal(module.get_submodule('internal'), root_module)
- register_functions_ns3_TimeStepPrecision(module.get_submodule('TimeStepPrecision'), 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_internal(module, root_module):
- return
-
-def register_functions_ns3_TimeStepPrecision(module, 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
diff --git a/bindings/python/ns3_module_mobility.py b/bindings/python/ns3_module_mobility.py
index 0b3cbb75e..48a316457 100644
--- a/bindings/python/ns3_module_mobility.py
+++ b/bindings/python/ns3_module_mobility.py
@@ -48,10 +48,10 @@ def register_types(module):
## hierarchical-mobility-model.h: ns3::HierarchicalMobilityModel [class]
module.add_class('HierarchicalMobilityModel', parent=root_module['ns3::MobilityModel'])
- ## Register a nested module for the namespace internal
+ ## Register a nested module for the namespace Config
- nested_module = module.add_cpp_namespace('internal')
- register_types_ns3_internal(nested_module)
+ nested_module = module.add_cpp_namespace('Config')
+ register_types_ns3_Config(nested_module)
## Register a nested module for the namespace TimeStepPrecision
@@ -60,10 +60,10 @@ def register_types(module):
register_types_ns3_TimeStepPrecision(nested_module)
- ## Register a nested module for the namespace Config
+ ## Register a nested module for the namespace internal
- nested_module = module.add_cpp_namespace('Config')
- register_types_ns3_Config(nested_module)
+ nested_module = module.add_cpp_namespace('internal')
+ register_types_ns3_internal(nested_module)
## Register a nested module for the namespace olsr
@@ -72,7 +72,7 @@ def register_types(module):
register_types_ns3_olsr(nested_module)
-def register_types_ns3_internal(module):
+def register_types_ns3_Config(module):
root_module = module.get_root()
@@ -80,7 +80,7 @@ def register_types_ns3_TimeStepPrecision(module):
root_module = module.get_root()
-def register_types_ns3_Config(module):
+def register_types_ns3_internal(module):
root_module = module.get_root()
@@ -692,33 +692,33 @@ def register_Ns3HierarchicalMobilityModel_methods(root_module, cls):
def register_functions(root_module):
module = root_module
- ## rectangle.h: extern ns3::Ptr ns3::MakeRectangleChecker() [free function]
- module.add_function('MakeRectangleChecker',
- 'ns3::Ptr< ns3::AttributeChecker const >',
- [])
## vector.h: extern double ns3::CalculateDistance(ns3::Vector const & a, ns3::Vector const & b) [free function]
module.add_function('CalculateDistance',
'double',
[param('ns3::Vector const &', 'a'), param('ns3::Vector const &', 'b')])
+ ## rectangle.h: extern ns3::Ptr ns3::MakeRectangleChecker() [free function]
+ module.add_function('MakeRectangleChecker',
+ 'ns3::Ptr< ns3::AttributeChecker const >',
+ [])
## vector.h: extern ns3::Ptr ns3::MakeVectorChecker() [free function]
module.add_function('MakeVectorChecker',
'ns3::Ptr< ns3::AttributeChecker const >',
[])
- register_functions_ns3_internal(module.get_submodule('internal'), root_module)
- register_functions_ns3_TimeStepPrecision(module.get_submodule('TimeStepPrecision'), 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_internal(module, root_module):
- return
-
-def register_functions_ns3_TimeStepPrecision(module, 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
diff --git a/bindings/python/ns3_module_node.py b/bindings/python/ns3_module_node.py
index 805e8747e..bab18224f 100644
--- a/bindings/python/ns3_module_node.py
+++ b/bindings/python/ns3_module_node.py
@@ -9,6 +9,10 @@ def register_types(module):
module.add_class('Address')
## address.h: ns3::Address::MaxSize_e [enumeration]
module.add_enum('MaxSize_e', ['MAX_SIZE'], outer_class=root_module['ns3::Address'])
+ ## inet6-socket-address.h: ns3::Inet6SocketAddress [class]
+ module.add_class('Inet6SocketAddress')
+ ## inet6-socket-address.h: ns3::Inet6SocketAddress [class]
+ root_module['ns3::Inet6SocketAddress'].implicitly_converts_to(root_module['ns3::Address'])
## inet-socket-address.h: ns3::InetSocketAddress [class]
module.add_class('InetSocketAddress')
## inet-socket-address.h: ns3::InetSocketAddress [class]
@@ -25,6 +29,12 @@ def register_types(module):
module.add_class('Ipv4MulticastRoute')
## ipv4-route.h: ns3::Ipv4Route [class]
module.add_class('Ipv4Route')
+ ## ipv6-address.h: ns3::Ipv6Address [class]
+ module.add_class('Ipv6Address')
+ ## ipv6-address.h: ns3::Ipv6Address [class]
+ root_module['ns3::Ipv6Address'].implicitly_converts_to(root_module['ns3::Address'])
+ ## ipv6-address.h: ns3::Ipv6Prefix [class]
+ module.add_class('Ipv6Prefix')
## mac48-address.h: ns3::Mac48Address [class]
module.add_class('Mac48Address')
## mac48-address.h: ns3::Mac48Address [class]
@@ -49,6 +59,18 @@ def register_types(module):
module.add_class('Ipv4MaskChecker', parent=root_module['ns3::AttributeChecker'])
## ipv4-address.h: ns3::Ipv4MaskValue [class]
module.add_class('Ipv4MaskValue', parent=root_module['ns3::AttributeValue'])
+ ## ipv6-address.h: ns3::Ipv6AddressChecker [class]
+ module.add_class('Ipv6AddressChecker', parent=root_module['ns3::AttributeChecker'])
+ ## ipv6-address.h: ns3::Ipv6AddressValue [class]
+ module.add_class('Ipv6AddressValue', parent=root_module['ns3::AttributeValue'])
+ ## ipv6-header.h: ns3::Ipv6Header [class]
+ module.add_class('Ipv6Header', parent=root_module['ns3::Header'])
+ ## ipv6-header.h: ns3::Ipv6Header::NextHeader_e [enumeration]
+ module.add_enum('NextHeader_e', ['IPV6_EXT_HOP_BY_HOP', 'IPV6_IPV4', 'IPV6_TCP', 'IPV6_UDP', 'IPV6_IPV6', 'IPV6_EXT_ROUTING', 'IPV6_EXT_FRAGMENTATION', 'IPV6_EXT_CONFIDENTIALITY', 'IPV6_EXT_AUTHENTIFICATION', 'IPV6_ICMPV6', 'IPV6_EXT_END', 'IPV6_EXT_DESTINATION', 'IPV6_SCTP', 'IPV6_EXT_MOBILITY', 'IPV6_UDP_LITE'], outer_class=root_module['ns3::Ipv6Header'])
+ ## ipv6-address.h: ns3::Ipv6PrefixChecker [class]
+ module.add_class('Ipv6PrefixChecker', parent=root_module['ns3::AttributeChecker'])
+ ## ipv6-address.h: ns3::Ipv6PrefixValue [class]
+ module.add_class('Ipv6PrefixValue', parent=root_module['ns3::AttributeValue'])
## llc-snap-header.h: ns3::LlcSnapHeader [class]
module.add_class('LlcSnapHeader', parent=root_module['ns3::Header'])
## mac48-address.h: ns3::Mac48AddressChecker [class]
@@ -67,6 +89,8 @@ def register_types(module):
module.add_class('SocketFactory', parent=root_module['ns3::Object'])
## socket.h: ns3::SocketIpTtlTag [class]
module.add_class('SocketIpTtlTag', parent=root_module['ns3::Tag'])
+ ## socket.h: ns3::SocketSetDontFragmentTag [class]
+ module.add_class('SocketSetDontFragmentTag', parent=root_module['ns3::Tag'])
## tcp-socket.h: ns3::TcpSocket [class]
module.add_class('TcpSocket', parent=root_module['ns3::Socket'])
## tcp-socket-factory.h: ns3::TcpSocketFactory [class]
@@ -89,14 +113,18 @@ def register_types(module):
module.add_class('EthernetHeader', parent=root_module['ns3::Header'])
## ethernet-trailer.h: ns3::EthernetTrailer [class]
module.add_class('EthernetTrailer', parent=root_module['ns3::Trailer'])
+ ## icmp-socket.h: ns3::IcmpSocket [class]
+ module.add_class('IcmpSocket', parent=root_module['ns3::Socket'])
## ipv4.h: ns3::Ipv4 [class]
module.add_class('Ipv4', parent=root_module['ns3::Object'])
+ ## ipv4-raw-socket-factory.h: ns3::Ipv4RawSocketFactory [class]
+ module.add_class('Ipv4RawSocketFactory', parent=root_module['ns3::SocketFactory'])
## ipv4.h: ns3::Ipv4RoutingProtocol [class]
module.add_class('Ipv4RoutingProtocol', parent=root_module['ns3::Object'])
## net-device.h: ns3::NetDevice [class]
module.add_class('NetDevice', parent=root_module['ns3::Object'])
## net-device.h: ns3::NetDevice::PacketType [enumeration]
- module.add_enum('PacketType', ['PACKET_HOST', 'PACKET_BROADCAST', 'PACKET_MULTICAST', 'PACKET_OTHERHOST'], outer_class=root_module['ns3::NetDevice'])
+ module.add_enum('PacketType', ['PACKET_HOST', 'NS3_PACKET_HOST', 'PACKET_BROADCAST', 'NS3_PACKET_BROADCAST', 'PACKET_MULTICAST', 'NS3_PACKET_MULTICAST', 'PACKET_OTHERHOST', 'NS3_PACKET_OTHERHOST'], outer_class=root_module['ns3::NetDevice'])
## node.h: ns3::Node [class]
module.add_class('Node', parent=root_module['ns3::Object'])
## packet-socket-factory.h: ns3::PacketSocketFactory [class]
@@ -106,10 +134,10 @@ def register_types(module):
## simple-net-device.h: ns3::SimpleNetDevice [class]
module.add_class('SimpleNetDevice', parent=root_module['ns3::NetDevice'])
- ## Register a nested module for the namespace internal
+ ## Register a nested module for the namespace Config
- nested_module = module.add_cpp_namespace('internal')
- register_types_ns3_internal(nested_module)
+ nested_module = module.add_cpp_namespace('Config')
+ register_types_ns3_Config(nested_module)
## Register a nested module for the namespace TimeStepPrecision
@@ -118,10 +146,10 @@ def register_types(module):
register_types_ns3_TimeStepPrecision(nested_module)
- ## Register a nested module for the namespace Config
+ ## Register a nested module for the namespace internal
- nested_module = module.add_cpp_namespace('Config')
- register_types_ns3_Config(nested_module)
+ nested_module = module.add_cpp_namespace('internal')
+ register_types_ns3_internal(nested_module)
## Register a nested module for the namespace olsr
@@ -130,7 +158,7 @@ def register_types(module):
register_types_ns3_olsr(nested_module)
-def register_types_ns3_internal(module):
+def register_types_ns3_Config(module):
root_module = module.get_root()
@@ -138,7 +166,7 @@ def register_types_ns3_TimeStepPrecision(module):
root_module = module.get_root()
-def register_types_ns3_Config(module):
+def register_types_ns3_internal(module):
root_module = module.get_root()
@@ -149,12 +177,15 @@ def register_types_ns3_olsr(module):
def register_methods(root_module):
register_Ns3Address_methods(root_module, root_module['ns3::Address'])
+ register_Ns3Inet6SocketAddress_methods(root_module, root_module['ns3::Inet6SocketAddress'])
register_Ns3InetSocketAddress_methods(root_module, root_module['ns3::InetSocketAddress'])
register_Ns3Ipv4Address_methods(root_module, root_module['ns3::Ipv4Address'])
register_Ns3Ipv4AddressGenerator_methods(root_module, root_module['ns3::Ipv4AddressGenerator'])
register_Ns3Ipv4Mask_methods(root_module, root_module['ns3::Ipv4Mask'])
register_Ns3Ipv4MulticastRoute_methods(root_module, root_module['ns3::Ipv4MulticastRoute'])
register_Ns3Ipv4Route_methods(root_module, root_module['ns3::Ipv4Route'])
+ register_Ns3Ipv6Address_methods(root_module, root_module['ns3::Ipv6Address'])
+ register_Ns3Ipv6Prefix_methods(root_module, root_module['ns3::Ipv6Prefix'])
register_Ns3Mac48Address_methods(root_module, root_module['ns3::Mac48Address'])
register_Ns3Mac64Address_methods(root_module, root_module['ns3::Mac64Address'])
register_Ns3NodeList_methods(root_module, root_module['ns3::NodeList'])
@@ -164,6 +195,11 @@ def register_methods(root_module):
register_Ns3Ipv4Header_methods(root_module, root_module['ns3::Ipv4Header'])
register_Ns3Ipv4MaskChecker_methods(root_module, root_module['ns3::Ipv4MaskChecker'])
register_Ns3Ipv4MaskValue_methods(root_module, root_module['ns3::Ipv4MaskValue'])
+ register_Ns3Ipv6AddressChecker_methods(root_module, root_module['ns3::Ipv6AddressChecker'])
+ register_Ns3Ipv6AddressValue_methods(root_module, root_module['ns3::Ipv6AddressValue'])
+ register_Ns3Ipv6Header_methods(root_module, root_module['ns3::Ipv6Header'])
+ register_Ns3Ipv6PrefixChecker_methods(root_module, root_module['ns3::Ipv6PrefixChecker'])
+ register_Ns3Ipv6PrefixValue_methods(root_module, root_module['ns3::Ipv6PrefixValue'])
register_Ns3LlcSnapHeader_methods(root_module, root_module['ns3::LlcSnapHeader'])
register_Ns3Mac48AddressChecker_methods(root_module, root_module['ns3::Mac48AddressChecker'])
register_Ns3Mac48AddressValue_methods(root_module, root_module['ns3::Mac48AddressValue'])
@@ -172,6 +208,7 @@ def register_methods(root_module):
register_Ns3SocketAddressTag_methods(root_module, root_module['ns3::SocketAddressTag'])
register_Ns3SocketFactory_methods(root_module, root_module['ns3::SocketFactory'])
register_Ns3SocketIpTtlTag_methods(root_module, root_module['ns3::SocketIpTtlTag'])
+ register_Ns3SocketSetDontFragmentTag_methods(root_module, root_module['ns3::SocketSetDontFragmentTag'])
register_Ns3TcpSocket_methods(root_module, root_module['ns3::TcpSocket'])
register_Ns3TcpSocketFactory_methods(root_module, root_module['ns3::TcpSocketFactory'])
register_Ns3UdpSocket_methods(root_module, root_module['ns3::UdpSocket'])
@@ -183,7 +220,9 @@ def register_methods(root_module):
register_Ns3DropTailQueue_methods(root_module, root_module['ns3::DropTailQueue'])
register_Ns3EthernetHeader_methods(root_module, root_module['ns3::EthernetHeader'])
register_Ns3EthernetTrailer_methods(root_module, root_module['ns3::EthernetTrailer'])
+ register_Ns3IcmpSocket_methods(root_module, root_module['ns3::IcmpSocket'])
register_Ns3Ipv4_methods(root_module, root_module['ns3::Ipv4'])
+ register_Ns3Ipv4RawSocketFactory_methods(root_module, root_module['ns3::Ipv4RawSocketFactory'])
register_Ns3Ipv4RoutingProtocol_methods(root_module, root_module['ns3::Ipv4RoutingProtocol'])
register_Ns3NetDevice_methods(root_module, root_module['ns3::NetDevice'])
register_Ns3Node_methods(root_module, root_module['ns3::Node'])
@@ -262,6 +301,49 @@ def register_Ns3Address_methods(root_module, cls):
is_const=True)
return
+def register_Ns3Inet6SocketAddress_methods(root_module, cls):
+ ## inet6-socket-address.h: ns3::Inet6SocketAddress::Inet6SocketAddress(ns3::Inet6SocketAddress const & arg0) [copy constructor]
+ cls.add_constructor([param('ns3::Inet6SocketAddress const &', 'arg0')])
+ ## inet6-socket-address.h: ns3::Inet6SocketAddress::Inet6SocketAddress(ns3::Ipv6Address ipv6, uint16_t port) [constructor]
+ cls.add_constructor([param('ns3::Ipv6Address', 'ipv6'), param('uint16_t', 'port')])
+ ## inet6-socket-address.h: ns3::Inet6SocketAddress::Inet6SocketAddress(ns3::Ipv6Address ipv6) [constructor]
+ cls.add_constructor([param('ns3::Ipv6Address', 'ipv6')])
+ ## inet6-socket-address.h: ns3::Inet6SocketAddress::Inet6SocketAddress(uint16_t port) [constructor]
+ cls.add_constructor([param('uint16_t', 'port')])
+ ## inet6-socket-address.h: ns3::Inet6SocketAddress::Inet6SocketAddress(char const * ipv6, uint16_t port) [constructor]
+ cls.add_constructor([param('char const *', 'ipv6'), param('uint16_t', 'port')])
+ ## inet6-socket-address.h: ns3::Inet6SocketAddress::Inet6SocketAddress(char const * ipv6) [constructor]
+ cls.add_constructor([param('char const *', 'ipv6')])
+ ## inet6-socket-address.h: uint16_t ns3::Inet6SocketAddress::GetPort() const [member function]
+ cls.add_method('GetPort',
+ 'uint16_t',
+ [],
+ is_const=True)
+ ## inet6-socket-address.h: void ns3::Inet6SocketAddress::SetPort(uint16_t port) [member function]
+ cls.add_method('SetPort',
+ 'void',
+ [param('uint16_t', 'port')])
+ ## inet6-socket-address.h: ns3::Ipv6Address ns3::Inet6SocketAddress::GetIpv6() const [member function]
+ cls.add_method('GetIpv6',
+ 'ns3::Ipv6Address',
+ [],
+ is_const=True)
+ ## inet6-socket-address.h: void ns3::Inet6SocketAddress::SetIpv6(ns3::Ipv6Address ipv6) [member function]
+ cls.add_method('SetIpv6',
+ 'void',
+ [param('ns3::Ipv6Address', 'ipv6')])
+ ## inet6-socket-address.h: static bool ns3::Inet6SocketAddress::IsMatchingType(ns3::Address const & addr) [member function]
+ cls.add_method('IsMatchingType',
+ 'bool',
+ [param('ns3::Address const &', 'addr')],
+ is_static=True)
+ ## inet6-socket-address.h: static ns3::Inet6SocketAddress ns3::Inet6SocketAddress::ConvertFrom(ns3::Address const & addr) [member function]
+ cls.add_method('ConvertFrom',
+ 'ns3::Inet6SocketAddress',
+ [param('ns3::Address const &', 'addr')],
+ is_static=True)
+ return
+
def register_Ns3InetSocketAddress_methods(root_module, cls):
## inet-socket-address.h: ns3::InetSocketAddress::InetSocketAddress(ns3::InetSocketAddress const & arg0) [copy constructor]
cls.add_constructor([param('ns3::InetSocketAddress const &', 'arg0')])
@@ -638,6 +720,203 @@ def register_Ns3Ipv4Route_methods(root_module, cls):
is_const=True)
return
+def register_Ns3Ipv6Address_methods(root_module, cls):
+ cls.add_binary_comparison_operator('!=')
+ cls.add_binary_comparison_operator('<')
+ cls.add_output_stream_operator()
+ cls.add_binary_comparison_operator('==')
+ ## ipv6-address.h: ns3::Ipv6Address::Ipv6Address() [constructor]
+ cls.add_constructor([])
+ ## ipv6-address.h: ns3::Ipv6Address::Ipv6Address(char const * address) [constructor]
+ cls.add_constructor([param('char const *', 'address')])
+ ## ipv6-address.h: ns3::Ipv6Address::Ipv6Address(uint8_t * address) [constructor]
+ cls.add_constructor([param('uint8_t *', 'address')])
+ ## ipv6-address.h: ns3::Ipv6Address::Ipv6Address(ns3::Ipv6Address const & addr) [copy constructor]
+ cls.add_constructor([param('ns3::Ipv6Address const &', 'addr')])
+ ## ipv6-address.h: ns3::Ipv6Address::Ipv6Address(ns3::Ipv6Address const * addr) [constructor]
+ cls.add_constructor([param('ns3::Ipv6Address const *', 'addr')])
+ ## ipv6-address.h: ns3::Ipv6Address ns3::Ipv6Address::CombinePrefix(ns3::Ipv6Prefix const & prefix) [member function]
+ cls.add_method('CombinePrefix',
+ 'ns3::Ipv6Address',
+ [param('ns3::Ipv6Prefix const &', 'prefix')])
+ ## ipv6-address.h: static ns3::Ipv6Address ns3::Ipv6Address::ConvertFrom(ns3::Address const & address) [member function]
+ cls.add_method('ConvertFrom',
+ 'ns3::Ipv6Address',
+ [param('ns3::Address const &', 'address')],
+ is_static=True)
+ ## ipv6-address.h: static ns3::Ipv6Address ns3::Ipv6Address::Deserialize(uint8_t const * buf) [member function]
+ cls.add_method('Deserialize',
+ 'ns3::Ipv6Address',
+ [param('uint8_t const *', 'buf')],
+ is_static=True)
+ ## ipv6-address.h: static ns3::Ipv6Address ns3::Ipv6Address::GetAllHostsMulticast() [member function]
+ cls.add_method('GetAllHostsMulticast',
+ 'ns3::Ipv6Address',
+ [],
+ is_static=True)
+ ## ipv6-address.h: static ns3::Ipv6Address ns3::Ipv6Address::GetAllNodesMulticast() [member function]
+ cls.add_method('GetAllNodesMulticast',
+ 'ns3::Ipv6Address',
+ [],
+ is_static=True)
+ ## ipv6-address.h: static ns3::Ipv6Address ns3::Ipv6Address::GetAllRoutersMulticast() [member function]
+ cls.add_method('GetAllRoutersMulticast',
+ 'ns3::Ipv6Address',
+ [],
+ is_static=True)
+ ## ipv6-address.h: static ns3::Ipv6Address ns3::Ipv6Address::GetAny() [member function]
+ cls.add_method('GetAny',
+ 'ns3::Ipv6Address',
+ [],
+ is_static=True)
+ ## ipv6-address.h: void ns3::Ipv6Address::GetBytes(uint8_t * buf) const [member function]
+ cls.add_method('GetBytes',
+ 'void',
+ [param('uint8_t *', 'buf')],
+ is_const=True)
+ ## ipv6-address.h: static ns3::Ipv6Address ns3::Ipv6Address::GetLoopback() [member function]
+ cls.add_method('GetLoopback',
+ 'ns3::Ipv6Address',
+ [],
+ is_static=True)
+ ## ipv6-address.h: static ns3::Ipv6Address ns3::Ipv6Address::GetZero() [member function]
+ cls.add_method('GetZero',
+ 'ns3::Ipv6Address',
+ [],
+ is_static=True)
+ ## ipv6-address.h: bool ns3::Ipv6Address::IsAllHostsMulticast() const [member function]
+ cls.add_method('IsAllHostsMulticast',
+ 'bool',
+ [],
+ is_const=True)
+ ## ipv6-address.h: bool ns3::Ipv6Address::IsAllNodesMulticast() const [member function]
+ cls.add_method('IsAllNodesMulticast',
+ 'bool',
+ [],
+ is_const=True)
+ ## ipv6-address.h: bool ns3::Ipv6Address::IsAllRoutersMulticast() const [member function]
+ cls.add_method('IsAllRoutersMulticast',
+ 'bool',
+ [],
+ is_const=True)
+ ## ipv6-address.h: bool ns3::Ipv6Address::IsAny() const [member function]
+ cls.add_method('IsAny',
+ 'bool',
+ [],
+ is_const=True)
+ ## ipv6-address.h: bool ns3::Ipv6Address::IsEqual(ns3::Ipv6Address const & other) const [member function]
+ cls.add_method('IsEqual',
+ 'bool',
+ [param('ns3::Ipv6Address const &', 'other')],
+ is_const=True)
+ ## ipv6-address.h: bool ns3::Ipv6Address::IsLinkLocal() const [member function]
+ cls.add_method('IsLinkLocal',
+ 'bool',
+ [],
+ is_const=True)
+ ## ipv6-address.h: bool ns3::Ipv6Address::IsLocalhost() const [member function]
+ cls.add_method('IsLocalhost',
+ 'bool',
+ [],
+ is_const=True)
+ ## ipv6-address.h: static bool ns3::Ipv6Address::IsMatchingType(ns3::Address const & address) [member function]
+ cls.add_method('IsMatchingType',
+ 'bool',
+ [param('ns3::Address const &', 'address')],
+ is_static=True)
+ ## ipv6-address.h: bool ns3::Ipv6Address::IsMulticast() const [member function]
+ cls.add_method('IsMulticast',
+ 'bool',
+ [],
+ is_const=True)
+ ## ipv6-address.h: bool ns3::Ipv6Address::IsSolicitedMulticast() const [member function]
+ cls.add_method('IsSolicitedMulticast',
+ 'bool',
+ [],
+ is_const=True)
+ ## ipv6-address.h: static ns3::Ipv6Address ns3::Ipv6Address::MakeAutoconfiguredAddress(ns3::Mac48Address addr, ns3::Ipv6Address prefix) [member function]
+ cls.add_method('MakeAutoconfiguredAddress',
+ 'ns3::Ipv6Address',
+ [param('ns3::Mac48Address', 'addr'), param('ns3::Ipv6Address', 'prefix')],
+ is_static=True)
+ ## ipv6-address.h: static ns3::Ipv6Address ns3::Ipv6Address::MakeAutoconfiguredLinkLocalAddress(ns3::Mac48Address mac) [member function]
+ cls.add_method('MakeAutoconfiguredLinkLocalAddress',
+ 'ns3::Ipv6Address',
+ [param('ns3::Mac48Address', 'mac')],
+ is_static=True)
+ ## ipv6-address.h: static ns3::Ipv6Address ns3::Ipv6Address::MakeSolicitedAddress(ns3::Ipv6Address addr) [member function]
+ cls.add_method('MakeSolicitedAddress',
+ 'ns3::Ipv6Address',
+ [param('ns3::Ipv6Address', 'addr')],
+ is_static=True)
+ ## ipv6-address.h: void ns3::Ipv6Address::Print(std::ostream & os) const [member function]
+ cls.add_method('Print',
+ 'void',
+ [param('std::ostream &', 'os')],
+ is_const=True)
+ ## ipv6-address.h: void ns3::Ipv6Address::Serialize(uint8_t * buf) const [member function]
+ cls.add_method('Serialize',
+ 'void',
+ [param('uint8_t *', 'buf')],
+ is_const=True)
+ ## ipv6-address.h: void ns3::Ipv6Address::Set(char const * address) [member function]
+ cls.add_method('Set',
+ 'void',
+ [param('char const *', 'address')])
+ ## ipv6-address.h: void ns3::Ipv6Address::Set(uint8_t * address) [member function]
+ cls.add_method('Set',
+ 'void',
+ [param('uint8_t *', 'address')])
+ return
+
+def register_Ns3Ipv6Prefix_methods(root_module, cls):
+ cls.add_binary_comparison_operator('!=')
+ cls.add_output_stream_operator()
+ cls.add_binary_comparison_operator('==')
+ ## ipv6-address.h: ns3::Ipv6Prefix::Ipv6Prefix() [constructor]
+ cls.add_constructor([])
+ ## ipv6-address.h: ns3::Ipv6Prefix::Ipv6Prefix(uint8_t * prefix) [constructor]
+ cls.add_constructor([param('uint8_t *', 'prefix')])
+ ## ipv6-address.h: ns3::Ipv6Prefix::Ipv6Prefix(char const * prefix) [constructor]
+ cls.add_constructor([param('char const *', 'prefix')])
+ ## ipv6-address.h: ns3::Ipv6Prefix::Ipv6Prefix(uint8_t prefix) [constructor]
+ cls.add_constructor([param('uint8_t', 'prefix')])
+ ## ipv6-address.h: ns3::Ipv6Prefix::Ipv6Prefix(ns3::Ipv6Prefix const & prefix) [copy constructor]
+ cls.add_constructor([param('ns3::Ipv6Prefix const &', 'prefix')])
+ ## ipv6-address.h: ns3::Ipv6Prefix::Ipv6Prefix(ns3::Ipv6Prefix const * prefix) [constructor]
+ cls.add_constructor([param('ns3::Ipv6Prefix const *', 'prefix')])
+ ## ipv6-address.h: void ns3::Ipv6Prefix::GetBytes(uint8_t * buf) const [member function]
+ cls.add_method('GetBytes',
+ 'void',
+ [param('uint8_t *', 'buf')],
+ is_const=True)
+ ## ipv6-address.h: static ns3::Ipv6Prefix ns3::Ipv6Prefix::GetLoopback() [member function]
+ cls.add_method('GetLoopback',
+ 'ns3::Ipv6Prefix',
+ [],
+ is_static=True)
+ ## ipv6-address.h: static ns3::Ipv6Prefix ns3::Ipv6Prefix::GetZero() [member function]
+ cls.add_method('GetZero',
+ 'ns3::Ipv6Prefix',
+ [],
+ is_static=True)
+ ## ipv6-address.h: bool ns3::Ipv6Prefix::IsEqual(ns3::Ipv6Prefix const & other) const [member function]
+ cls.add_method('IsEqual',
+ 'bool',
+ [param('ns3::Ipv6Prefix const &', 'other')],
+ is_const=True)
+ ## ipv6-address.h: bool ns3::Ipv6Prefix::IsMatch(ns3::Ipv6Address a, ns3::Ipv6Address b) const [member function]
+ cls.add_method('IsMatch',
+ 'bool',
+ [param('ns3::Ipv6Address', 'a'), param('ns3::Ipv6Address', 'b')],
+ is_const=True)
+ ## ipv6-address.h: void ns3::Ipv6Prefix::Print(std::ostream & os) const [member function]
+ cls.add_method('Print',
+ 'void',
+ [param('std::ostream &', 'os')],
+ is_const=True)
+ return
+
def register_Ns3Mac48Address_methods(root_module, cls):
cls.add_binary_comparison_operator('!=')
cls.add_binary_comparison_operator('<')
@@ -678,6 +957,16 @@ def register_Ns3Mac48Address_methods(root_module, cls):
'ns3::Mac48Address',
[param('ns3::Ipv4Address', 'address')],
is_static=True)
+ ## mac48-address.h: static ns3::Mac48Address ns3::Mac48Address::GetMulticast(ns3::Ipv6Address address) [member function]
+ cls.add_method('GetMulticast',
+ 'ns3::Mac48Address',
+ [param('ns3::Ipv6Address', 'address')],
+ is_static=True)
+ ## mac48-address.h: static ns3::Mac48Address ns3::Mac48Address::GetMulticast6Prefix() [member function]
+ cls.add_method('GetMulticast6Prefix',
+ 'ns3::Mac48Address',
+ [],
+ is_static=True)
## mac48-address.h: static ns3::Mac48Address ns3::Mac48Address::GetMulticastPrefix() [member function]
cls.add_method('GetMulticastPrefix',
'ns3::Mac48Address',
@@ -1050,6 +1339,186 @@ def register_Ns3Ipv4MaskValue_methods(root_module, cls):
is_virtual=True)
return
+def register_Ns3Ipv6AddressChecker_methods(root_module, cls):
+ ## ipv6-address.h: ns3::Ipv6AddressChecker::Ipv6AddressChecker(ns3::Ipv6AddressChecker const & arg0) [copy constructor]
+ cls.add_constructor([param('ns3::Ipv6AddressChecker const &', 'arg0')])
+ ## ipv6-address.h: ns3::Ipv6AddressChecker::Ipv6AddressChecker() [constructor]
+ cls.add_constructor([])
+ return
+
+def register_Ns3Ipv6AddressValue_methods(root_module, cls):
+ ## ipv6-address.h: ns3::Ipv6AddressValue::Ipv6AddressValue(ns3::Ipv6AddressValue const & arg0) [copy constructor]
+ cls.add_constructor([param('ns3::Ipv6AddressValue const &', 'arg0')])
+ ## ipv6-address.h: ns3::Ipv6AddressValue::Ipv6AddressValue() [constructor]
+ cls.add_constructor([])
+ ## ipv6-address.h: ns3::Ipv6AddressValue::Ipv6AddressValue(ns3::Ipv6Address const & value) [constructor]
+ cls.add_constructor([param('ns3::Ipv6Address const &', 'value')])
+ ## ipv6-address.h: void ns3::Ipv6AddressValue::Set(ns3::Ipv6Address const & value) [member function]
+ cls.add_method('Set',
+ 'void',
+ [param('ns3::Ipv6Address const &', 'value')])
+ ## ipv6-address.h: ns3::Ipv6Address ns3::Ipv6AddressValue::Get() const [member function]
+ cls.add_method('Get',
+ 'ns3::Ipv6Address',
+ [],
+ is_const=True)
+ ## ipv6-address.h: ns3::Ptr ns3::Ipv6AddressValue::Copy() const [member function]
+ cls.add_method('Copy',
+ 'ns3::Ptr< ns3::AttributeValue >',
+ [],
+ is_const=True, is_virtual=True)
+ ## ipv6-address.h: std::string ns3::Ipv6AddressValue::SerializeToString(ns3::Ptr checker) const [member function]
+ cls.add_method('SerializeToString',
+ 'std::string',
+ [param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')],
+ is_const=True, is_virtual=True)
+ ## ipv6-address.h: bool ns3::Ipv6AddressValue::DeserializeFromString(std::string value, ns3::Ptr checker) [member function]
+ cls.add_method('DeserializeFromString',
+ 'bool',
+ [param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')],
+ is_virtual=True)
+ return
+
+def register_Ns3Ipv6Header_methods(root_module, cls):
+ ## ipv6-header.h: ns3::Ipv6Header::Ipv6Header(ns3::Ipv6Header const & arg0) [copy constructor]
+ cls.add_constructor([param('ns3::Ipv6Header const &', 'arg0')])
+ ## ipv6-header.h: static ns3::TypeId ns3::Ipv6Header::GetTypeId() [member function]
+ cls.add_method('GetTypeId',
+ 'ns3::TypeId',
+ [],
+ is_static=True)
+ ## ipv6-header.h: ns3::TypeId ns3::Ipv6Header::GetInstanceTypeId() const [member function]
+ cls.add_method('GetInstanceTypeId',
+ 'ns3::TypeId',
+ [],
+ is_const=True, is_virtual=True)
+ ## ipv6-header.h: ns3::Ipv6Header::Ipv6Header() [constructor]
+ cls.add_constructor([])
+ ## ipv6-header.h: void ns3::Ipv6Header::SetTrafficClass(uint8_t traffic) [member function]
+ cls.add_method('SetTrafficClass',
+ 'void',
+ [param('uint8_t', 'traffic')])
+ ## ipv6-header.h: uint8_t ns3::Ipv6Header::GetTrafficClass() const [member function]
+ cls.add_method('GetTrafficClass',
+ 'uint8_t',
+ [],
+ is_const=True)
+ ## ipv6-header.h: void ns3::Ipv6Header::SetFlowLabel(uint32_t flow) [member function]
+ cls.add_method('SetFlowLabel',
+ 'void',
+ [param('uint32_t', 'flow')])
+ ## ipv6-header.h: uint32_t ns3::Ipv6Header::GetFlowLabel() const [member function]
+ cls.add_method('GetFlowLabel',
+ 'uint32_t',
+ [],
+ is_const=True)
+ ## ipv6-header.h: void ns3::Ipv6Header::SetPayloadLength(uint16_t len) [member function]
+ cls.add_method('SetPayloadLength',
+ 'void',
+ [param('uint16_t', 'len')])
+ ## ipv6-header.h: uint16_t ns3::Ipv6Header::GetPayloadLength() const [member function]
+ cls.add_method('GetPayloadLength',
+ 'uint16_t',
+ [],
+ is_const=True)
+ ## ipv6-header.h: void ns3::Ipv6Header::SetNextHeader(uint8_t next) [member function]
+ cls.add_method('SetNextHeader',
+ 'void',
+ [param('uint8_t', 'next')])
+ ## ipv6-header.h: uint8_t ns3::Ipv6Header::GetNextHeader() const [member function]
+ cls.add_method('GetNextHeader',
+ 'uint8_t',
+ [],
+ is_const=True)
+ ## ipv6-header.h: void ns3::Ipv6Header::SetHopLimit(uint8_t limit) [member function]
+ cls.add_method('SetHopLimit',
+ 'void',
+ [param('uint8_t', 'limit')])
+ ## ipv6-header.h: uint8_t ns3::Ipv6Header::GetHopLimit() const [member function]
+ cls.add_method('GetHopLimit',
+ 'uint8_t',
+ [],
+ is_const=True)
+ ## ipv6-header.h: void ns3::Ipv6Header::SetSourceAddress(ns3::Ipv6Address src) [member function]
+ cls.add_method('SetSourceAddress',
+ 'void',
+ [param('ns3::Ipv6Address', 'src')])
+ ## ipv6-header.h: ns3::Ipv6Address ns3::Ipv6Header::GetSourceAddress() const [member function]
+ cls.add_method('GetSourceAddress',
+ 'ns3::Ipv6Address',
+ [],
+ is_const=True)
+ ## ipv6-header.h: void ns3::Ipv6Header::SetDestinationAddress(ns3::Ipv6Address dst) [member function]
+ cls.add_method('SetDestinationAddress',
+ 'void',
+ [param('ns3::Ipv6Address', 'dst')])
+ ## ipv6-header.h: ns3::Ipv6Address ns3::Ipv6Header::GetDestinationAddress() const [member function]
+ cls.add_method('GetDestinationAddress',
+ 'ns3::Ipv6Address',
+ [],
+ is_const=True)
+ ## ipv6-header.h: void ns3::Ipv6Header::Print(std::ostream & os) const [member function]
+ cls.add_method('Print',
+ 'void',
+ [param('std::ostream &', 'os')],
+ is_const=True, is_virtual=True)
+ ## ipv6-header.h: uint32_t ns3::Ipv6Header::GetSerializedSize() const [member function]
+ cls.add_method('GetSerializedSize',
+ 'uint32_t',
+ [],
+ is_const=True, is_virtual=True)
+ ## ipv6-header.h: void ns3::Ipv6Header::Serialize(ns3::Buffer::Iterator start) const [member function]
+ cls.add_method('Serialize',
+ 'void',
+ [param('ns3::Buffer::Iterator', 'start')],
+ is_const=True, is_virtual=True)
+ ## ipv6-header.h: uint32_t ns3::Ipv6Header::Deserialize(ns3::Buffer::Iterator start) [member function]
+ cls.add_method('Deserialize',
+ 'uint32_t',
+ [param('ns3::Buffer::Iterator', 'start')],
+ is_virtual=True)
+ return
+
+def register_Ns3Ipv6PrefixChecker_methods(root_module, cls):
+ ## ipv6-address.h: ns3::Ipv6PrefixChecker::Ipv6PrefixChecker(ns3::Ipv6PrefixChecker const & arg0) [copy constructor]
+ cls.add_constructor([param('ns3::Ipv6PrefixChecker const &', 'arg0')])
+ ## ipv6-address.h: ns3::Ipv6PrefixChecker::Ipv6PrefixChecker() [constructor]
+ cls.add_constructor([])
+ return
+
+def register_Ns3Ipv6PrefixValue_methods(root_module, cls):
+ ## ipv6-address.h: ns3::Ipv6PrefixValue::Ipv6PrefixValue(ns3::Ipv6PrefixValue const & arg0) [copy constructor]
+ cls.add_constructor([param('ns3::Ipv6PrefixValue const &', 'arg0')])
+ ## ipv6-address.h: ns3::Ipv6PrefixValue::Ipv6PrefixValue() [constructor]
+ cls.add_constructor([])
+ ## ipv6-address.h: ns3::Ipv6PrefixValue::Ipv6PrefixValue(ns3::Ipv6Prefix const & value) [constructor]
+ cls.add_constructor([param('ns3::Ipv6Prefix const &', 'value')])
+ ## ipv6-address.h: void ns3::Ipv6PrefixValue::Set(ns3::Ipv6Prefix const & value) [member function]
+ cls.add_method('Set',
+ 'void',
+ [param('ns3::Ipv6Prefix const &', 'value')])
+ ## ipv6-address.h: ns3::Ipv6Prefix ns3::Ipv6PrefixValue::Get() const [member function]
+ cls.add_method('Get',
+ 'ns3::Ipv6Prefix',
+ [],
+ is_const=True)
+ ## ipv6-address.h: ns3::Ptr ns3::Ipv6PrefixValue::Copy() const [member function]
+ cls.add_method('Copy',
+ 'ns3::Ptr< ns3::AttributeValue >',
+ [],
+ is_const=True, is_virtual=True)
+ ## ipv6-address.h: std::string ns3::Ipv6PrefixValue::SerializeToString(ns3::Ptr checker) const [member function]
+ cls.add_method('SerializeToString',
+ 'std::string',
+ [param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')],
+ is_const=True, is_virtual=True)
+ ## ipv6-address.h: bool ns3::Ipv6PrefixValue::DeserializeFromString(std::string value, ns3::Ptr checker) [member function]
+ cls.add_method('DeserializeFromString',
+ 'bool',
+ [param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')],
+ is_virtual=True)
+ return
+
def register_Ns3LlcSnapHeader_methods(root_module, cls):
## llc-snap-header.h: ns3::LlcSnapHeader::LlcSnapHeader(ns3::LlcSnapHeader const & arg0) [copy constructor]
cls.add_constructor([param('ns3::LlcSnapHeader const &', 'arg0')])
@@ -1507,6 +1976,56 @@ def register_Ns3SocketIpTtlTag_methods(root_module, cls):
is_const=True, is_virtual=True)
return
+def register_Ns3SocketSetDontFragmentTag_methods(root_module, cls):
+ ## socket.h: ns3::SocketSetDontFragmentTag::SocketSetDontFragmentTag(ns3::SocketSetDontFragmentTag const & arg0) [copy constructor]
+ cls.add_constructor([param('ns3::SocketSetDontFragmentTag const &', 'arg0')])
+ ## socket.h: ns3::SocketSetDontFragmentTag::SocketSetDontFragmentTag() [constructor]
+ cls.add_constructor([])
+ ## socket.h: void ns3::SocketSetDontFragmentTag::Enable() [member function]
+ cls.add_method('Enable',
+ 'void',
+ [])
+ ## socket.h: void ns3::SocketSetDontFragmentTag::Disable() [member function]
+ cls.add_method('Disable',
+ 'void',
+ [])
+ ## socket.h: bool ns3::SocketSetDontFragmentTag::IsEnabled() const [member function]
+ cls.add_method('IsEnabled',
+ 'bool',
+ [],
+ is_const=True)
+ ## socket.h: static ns3::TypeId ns3::SocketSetDontFragmentTag::GetTypeId() [member function]
+ cls.add_method('GetTypeId',
+ 'ns3::TypeId',
+ [],
+ is_static=True)
+ ## socket.h: ns3::TypeId ns3::SocketSetDontFragmentTag::GetInstanceTypeId() const [member function]
+ cls.add_method('GetInstanceTypeId',
+ 'ns3::TypeId',
+ [],
+ is_const=True, is_virtual=True)
+ ## socket.h: uint32_t ns3::SocketSetDontFragmentTag::GetSerializedSize() const [member function]
+ cls.add_method('GetSerializedSize',
+ 'uint32_t',
+ [],
+ is_const=True, is_virtual=True)
+ ## socket.h: void ns3::SocketSetDontFragmentTag::Serialize(ns3::TagBuffer i) const [member function]
+ cls.add_method('Serialize',
+ 'void',
+ [param('ns3::TagBuffer', 'i')],
+ is_const=True, is_virtual=True)
+ ## socket.h: void ns3::SocketSetDontFragmentTag::Deserialize(ns3::TagBuffer i) [member function]
+ cls.add_method('Deserialize',
+ 'void',
+ [param('ns3::TagBuffer', 'i')],
+ is_virtual=True)
+ ## socket.h: void ns3::SocketSetDontFragmentTag::Print(std::ostream & os) const [member function]
+ cls.add_method('Print',
+ 'void',
+ [param('std::ostream &', 'os')],
+ is_const=True, is_virtual=True)
+ return
+
def register_Ns3TcpSocket_methods(root_module, cls):
## tcp-socket.h: ns3::TcpSocket::TcpSocket(ns3::TcpSocket const & arg0) [copy constructor]
cls.add_constructor([param('ns3::TcpSocket const &', 'arg0')])
@@ -1661,6 +2180,16 @@ def register_Ns3UdpSocket_methods(root_module, cls):
'uint32_t',
[],
is_pure_virtual=True, is_const=True, visibility='private', is_virtual=True)
+ ## udp-socket.h: void ns3::UdpSocket::SetMtuDiscover(bool discover) [member function]
+ cls.add_method('SetMtuDiscover',
+ 'void',
+ [param('bool', 'discover')],
+ is_pure_virtual=True, visibility='private', is_virtual=True)
+ ## udp-socket.h: bool ns3::UdpSocket::GetMtuDiscover() const [member function]
+ cls.add_method('GetMtuDiscover',
+ 'bool',
+ [],
+ is_pure_virtual=True, is_const=True, visibility='private', is_virtual=True)
return
def register_Ns3UdpSocketFactory_methods(root_module, cls):
@@ -1975,6 +2504,98 @@ def register_Ns3EthernetTrailer_methods(root_module, cls):
is_virtual=True)
return
+def register_Ns3IcmpSocket_methods(root_module, cls):
+ ## icmp-socket.h: ns3::IcmpSocket::IcmpSocket(ns3::IcmpSocket const & arg0) [copy constructor]
+ cls.add_constructor([param('ns3::IcmpSocket const &', 'arg0')])
+ ## icmp-socket.h: static ns3::TypeId ns3::IcmpSocket::GetTypeId() [member function]
+ cls.add_method('GetTypeId',
+ 'ns3::TypeId',
+ [],
+ is_static=True)
+ ## icmp-socket.h: ns3::IcmpSocket::IcmpSocket() [constructor]
+ cls.add_constructor([])
+ ## icmp-socket.h: ns3::Socket::SocketErrno ns3::IcmpSocket::GetErrno() const [member function]
+ cls.add_method('GetErrno',
+ 'ns3::Socket::SocketErrno',
+ [],
+ is_pure_virtual=True, is_const=True, is_virtual=True)
+ ## icmp-socket.h: ns3::Ptr ns3::IcmpSocket::GetNode() const [member function]
+ cls.add_method('GetNode',
+ 'ns3::Ptr< ns3::Node >',
+ [],
+ is_pure_virtual=True, is_const=True, is_virtual=True)
+ ## icmp-socket.h: int ns3::IcmpSocket::Bind() [member function]
+ cls.add_method('Bind',
+ 'int',
+ [],
+ is_pure_virtual=True, is_virtual=True)
+ ## icmp-socket.h: int ns3::IcmpSocket::Bind(ns3::Address const & addr) [member function]
+ cls.add_method('Bind',
+ 'int',
+ [param('ns3::Address const &', 'addr')],
+ is_pure_virtual=True, is_virtual=True)
+ ## icmp-socket.h: int ns3::IcmpSocket::Close() [member function]
+ cls.add_method('Close',
+ 'int',
+ [],
+ is_pure_virtual=True, is_virtual=True)
+ ## icmp-socket.h: int ns3::IcmpSocket::ShutdownSend() [member function]
+ cls.add_method('ShutdownSend',
+ 'int',
+ [],
+ is_pure_virtual=True, is_virtual=True)
+ ## icmp-socket.h: int ns3::IcmpSocket::ShutdownRecv() [member function]
+ cls.add_method('ShutdownRecv',
+ 'int',
+ [],
+ is_pure_virtual=True, is_virtual=True)
+ ## icmp-socket.h: int ns3::IcmpSocket::Connect(ns3::Address const & addr) [member function]
+ cls.add_method('Connect',
+ 'int',
+ [param('ns3::Address const &', 'addr')],
+ is_pure_virtual=True, is_virtual=True)
+ ## icmp-socket.h: int ns3::IcmpSocket::Send(ns3::Ptr p, uint32_t flags) [member function]
+ cls.add_method('Send',
+ 'int',
+ [param('ns3::Ptr< ns3::Packet >', 'p'), param('uint32_t', 'flags')],
+ is_pure_virtual=True, is_virtual=True)
+ ## icmp-socket.h: uint32_t ns3::IcmpSocket::GetTxAvailable() const [member function]
+ cls.add_method('GetTxAvailable',
+ 'uint32_t',
+ [],
+ is_pure_virtual=True, is_const=True, is_virtual=True)
+ ## icmp-socket.h: int ns3::IcmpSocket::SendTo(ns3::Ptr p, uint32_t flags, ns3::Address const & addr) [member function]
+ cls.add_method('SendTo',
+ 'int',
+ [param('ns3::Ptr< ns3::Packet >', 'p'), param('uint32_t', 'flags'), param('ns3::Address const &', 'addr')],
+ is_pure_virtual=True, is_virtual=True)
+ ## icmp-socket.h: ns3::Ptr ns3::IcmpSocket::Recv(uint32_t maxSize, uint32_t flags) [member function]
+ cls.add_method('Recv',
+ 'ns3::Ptr< ns3::Packet >',
+ [param('uint32_t', 'maxSize'), param('uint32_t', 'flags')],
+ is_pure_virtual=True, is_virtual=True)
+ ## icmp-socket.h: ns3::Ptr ns3::IcmpSocket::RecvFrom(uint32_t maxSize, uint32_t flags, ns3::Address & fromAddress) [member function]
+ cls.add_method('RecvFrom',
+ 'ns3::Ptr< ns3::Packet >',
+ [param('uint32_t', 'maxSize'), param('uint32_t', 'flags'), param('ns3::Address &', 'fromAddress')],
+ is_pure_virtual=True, is_virtual=True)
+ ## icmp-socket.h: uint32_t ns3::IcmpSocket::GetRxAvailable() const [member function]
+ cls.add_method('GetRxAvailable',
+ 'uint32_t',
+ [],
+ is_pure_virtual=True, is_const=True, is_virtual=True)
+ ## icmp-socket.h: uint32_t ns3::IcmpSocket::GetRcvBufSize() const [member function]
+ cls.add_method('GetRcvBufSize',
+ 'uint32_t',
+ [],
+ is_pure_virtual=True, is_const=True, visibility='private', is_virtual=True)
+ ## icmp-socket.h: void ns3::IcmpSocket::SetRcvBufSize(uint32_t rcvBufSize) [member function]
+ cls.add_method('SetRcvBufSize',
+ 'void',
+ [param('uint32_t', 'rcvBufSize')],
+ is_pure_virtual=True, visibility='private', is_virtual=True)
+ return
+
def register_Ns3Ipv4_methods(root_module, cls):
## ipv4.h: ns3::Ipv4::Ipv4(ns3::Ipv4 const & arg0) [copy constructor]
cls.add_constructor([param('ns3::Ipv4 const &', 'arg0')])
@@ -2167,6 +2788,18 @@ def register_Ns3Ipv4_methods(root_module, cls):
is_virtual=True)
return
+def register_Ns3Ipv4RawSocketFactory_methods(root_module, cls):
+ ## ipv4-raw-socket-factory.h: ns3::Ipv4RawSocketFactory::Ipv4RawSocketFactory(ns3::Ipv4RawSocketFactory const & arg0) [copy constructor]
+ cls.add_constructor([param('ns3::Ipv4RawSocketFactory const &', 'arg0')])
+ ## ipv4-raw-socket-factory.h: ns3::Ipv4RawSocketFactory::Ipv4RawSocketFactory() [constructor]
+ cls.add_constructor([])
+ ## ipv4-raw-socket-factory.h: static ns3::TypeId ns3::Ipv4RawSocketFactory::GetTypeId() [member function]
+ cls.add_method('GetTypeId',
+ 'ns3::TypeId',
+ [],
+ is_static=True)
+ return
+
def register_Ns3Ipv4RoutingProtocol_methods(root_module, cls):
## ipv4.h: ns3::Ipv4RoutingProtocol::IF_INDEX_ANY [variable]
cls.add_static_attribute('IF_INDEX_ANY', 'uint32_t const', is_const=True)
@@ -2261,16 +2894,16 @@ def register_Ns3NetDevice_methods(root_module, cls):
'bool',
[],
is_pure_virtual=True, is_const=True, is_virtual=True)
- ## net-device.h: ns3::Address ns3::NetDevice::GetMulticast() const [member function]
+ ## net-device.h: ns3::Address ns3::NetDevice::GetMulticast(ns3::Ipv4Address multicastGroup) const [member function]
cls.add_method('GetMulticast',
- 'ns3::Address',
- [],
- is_pure_virtual=True, is_const=True, is_virtual=True)
- ## net-device.h: ns3::Address ns3::NetDevice::MakeMulticastAddress(ns3::Ipv4Address multicastGroup) const [member function]
- cls.add_method('MakeMulticastAddress',
'ns3::Address',
[param('ns3::Ipv4Address', 'multicastGroup')],
is_pure_virtual=True, is_const=True, is_virtual=True)
+ ## net-device.h: ns3::Address ns3::NetDevice::GetMulticast(ns3::Ipv6Address addr) const [member function]
+ cls.add_method('GetMulticast',
+ 'ns3::Address',
+ [param('ns3::Ipv6Address', 'addr')],
+ is_pure_virtual=True, is_const=True, is_virtual=True)
## net-device.h: bool ns3::NetDevice::IsPointToPoint() const [member function]
cls.add_method('IsPointToPoint',
'bool',
@@ -2522,13 +3155,8 @@ def register_Ns3SimpleNetDevice_methods(root_module, cls):
'bool',
[],
is_const=True, is_virtual=True)
- ## simple-net-device.h: ns3::Address ns3::SimpleNetDevice::GetMulticast() const [member function]
+ ## simple-net-device.h: ns3::Address ns3::SimpleNetDevice::GetMulticast(ns3::Ipv4Address multicastGroup) const [member function]
cls.add_method('GetMulticast',
- 'ns3::Address',
- [],
- is_const=True, is_virtual=True)
- ## simple-net-device.h: ns3::Address ns3::SimpleNetDevice::MakeMulticastAddress(ns3::Ipv4Address multicastGroup) const [member function]
- cls.add_method('MakeMulticastAddress',
'ns3::Address',
[param('ns3::Ipv4Address', 'multicastGroup')],
is_const=True, is_virtual=True)
@@ -2567,6 +3195,11 @@ def register_Ns3SimpleNetDevice_methods(root_module, cls):
'void',
[param('ns3::Callback< bool, ns3::Ptr< ns3::NetDevice >, ns3::Ptr< ns3::Packet const >, unsigned short, ns3::Address const &, ns3::empty, ns3::empty >', 'cb')],
is_virtual=True)
+ ## simple-net-device.h: ns3::Address ns3::SimpleNetDevice::GetMulticast(ns3::Ipv6Address addr) const [member function]
+ cls.add_method('GetMulticast',
+ 'ns3::Address',
+ [param('ns3::Ipv6Address', 'addr')],
+ is_const=True, is_virtual=True)
## simple-net-device.h: void ns3::SimpleNetDevice::SetPromiscReceiveCallback(ns3::Callback, ns3::Ptr, unsigned short, ns3::Address const&, ns3::Address const&, ns3::NetDevice::PacketType> cb) [member function]
cls.add_method('SetPromiscReceiveCallback',
'void',
@@ -2586,10 +3219,30 @@ def register_Ns3SimpleNetDevice_methods(root_module, cls):
def register_functions(root_module):
module = root_module
- ## address-utils.h: extern void ns3::ReadFrom(ns3::Buffer::Iterator & i, ns3::Mac48Address & ad) [free function]
- module.add_function('ReadFrom',
- 'void',
- [param('ns3::Buffer::Iterator &', 'i'), param('ns3::Mac48Address &', 'ad')])
+ ## address.h: extern ns3::Ptr ns3::MakeAddressChecker() [free function]
+ module.add_function('MakeAddressChecker',
+ 'ns3::Ptr< ns3::AttributeChecker const >',
+ [])
+ ## ipv4-address.h: extern ns3::Ptr ns3::MakeIpv4AddressChecker() [free function]
+ module.add_function('MakeIpv4AddressChecker',
+ 'ns3::Ptr< ns3::AttributeChecker const >',
+ [])
+ ## ipv4-address.h: extern ns3::Ptr ns3::MakeIpv4MaskChecker() [free function]
+ module.add_function('MakeIpv4MaskChecker',
+ 'ns3::Ptr< ns3::AttributeChecker const >',
+ [])
+ ## ipv6-address.h: extern ns3::Ptr ns3::MakeIpv6AddressChecker() [free function]
+ module.add_function('MakeIpv6AddressChecker',
+ 'ns3::Ptr< ns3::AttributeChecker const >',
+ [])
+ ## ipv6-address.h: extern ns3::Ptr ns3::MakeIpv6PrefixChecker() [free function]
+ module.add_function('MakeIpv6PrefixChecker',
+ 'ns3::Ptr< ns3::AttributeChecker const >',
+ [])
+ ## mac48-address.h: extern ns3::Ptr ns3::MakeMac48AddressChecker() [free function]
+ module.add_function('MakeMac48AddressChecker',
+ 'ns3::Ptr< ns3::AttributeChecker const >',
+ [])
## address-utils.h: extern void ns3::ReadFrom(ns3::Buffer::Iterator & i, ns3::Address & ad, uint32_t len) [free function]
module.add_function('ReadFrom',
'void',
@@ -2598,14 +3251,14 @@ def register_functions(root_module):
module.add_function('ReadFrom',
'void',
[param('ns3::Buffer::Iterator &', 'i'), param('ns3::Ipv4Address &', 'ad')])
- ## ipv4-address.h: extern ns3::Ptr ns3::MakeIpv4AddressChecker() [free function]
- module.add_function('MakeIpv4AddressChecker',
- 'ns3::Ptr< ns3::AttributeChecker const >',
- [])
- ## address-utils.h: extern void ns3::WriteTo(ns3::Buffer::Iterator & i, ns3::Mac48Address ad) [free function]
- module.add_function('WriteTo',
+ ## address-utils.h: extern void ns3::ReadFrom(ns3::Buffer::Iterator & i, ns3::Ipv6Address & ad) [free function]
+ module.add_function('ReadFrom',
'void',
- [param('ns3::Buffer::Iterator &', 'i'), param('ns3::Mac48Address', 'ad')])
+ [param('ns3::Buffer::Iterator &', 'i'), param('ns3::Ipv6Address &', 'ad')])
+ ## address-utils.h: extern void ns3::ReadFrom(ns3::Buffer::Iterator & i, ns3::Mac48Address & ad) [free function]
+ module.add_function('ReadFrom',
+ 'void',
+ [param('ns3::Buffer::Iterator &', 'i'), param('ns3::Mac48Address &', 'ad')])
## address-utils.h: extern void ns3::WriteTo(ns3::Buffer::Iterator & i, ns3::Address const & ad) [free function]
module.add_function('WriteTo',
'void',
@@ -2614,33 +3267,29 @@ def register_functions(root_module):
module.add_function('WriteTo',
'void',
[param('ns3::Buffer::Iterator &', 'i'), param('ns3::Ipv4Address', 'ad')])
- ## address.h: extern ns3::Ptr ns3::MakeAddressChecker() [free function]
- module.add_function('MakeAddressChecker',
- 'ns3::Ptr< ns3::AttributeChecker const >',
- [])
- ## ipv4-address.h: extern ns3::Ptr ns3::MakeIpv4MaskChecker() [free function]
- module.add_function('MakeIpv4MaskChecker',
- 'ns3::Ptr< ns3::AttributeChecker const >',
- [])
- ## mac48-address.h: extern ns3::Ptr ns3::MakeMac48AddressChecker() [free function]
- module.add_function('MakeMac48AddressChecker',
- 'ns3::Ptr< ns3::AttributeChecker const >',
- [])
- register_functions_ns3_internal(module.get_submodule('internal'), root_module)
- register_functions_ns3_TimeStepPrecision(module.get_submodule('TimeStepPrecision'), root_module)
+ ## address-utils.h: extern void ns3::WriteTo(ns3::Buffer::Iterator & i, ns3::Ipv6Address ad) [free function]
+ module.add_function('WriteTo',
+ 'void',
+ [param('ns3::Buffer::Iterator &', 'i'), param('ns3::Ipv6Address', 'ad')])
+ ## address-utils.h: extern void ns3::WriteTo(ns3::Buffer::Iterator & i, ns3::Mac48Address ad) [free function]
+ module.add_function('WriteTo',
+ 'void',
+ [param('ns3::Buffer::Iterator &', 'i'), param('ns3::Mac48Address', 'ad')])
register_functions_ns3_Config(module.get_submodule('Config'), root_module)
+ register_functions_ns3_TimeStepPrecision(module.get_submodule('TimeStepPrecision'), root_module)
+ register_functions_ns3_internal(module.get_submodule('internal'), root_module)
register_functions_ns3_olsr(module.get_submodule('olsr'), root_module)
return
-def register_functions_ns3_internal(module, root_module):
- return
-
-def register_functions_ns3_TimeStepPrecision(module, 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
diff --git a/bindings/python/ns3_module_olsr.py b/bindings/python/ns3_module_olsr.py
index bf30ff817..9ee264a50 100644
--- a/bindings/python/ns3_module_olsr.py
+++ b/bindings/python/ns3_module_olsr.py
@@ -4,31 +4,31 @@ def register_types(module):
root_module = module.get_root()
- ## 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 TimeStepPrecision
-
- nested_module = module.add_cpp_namespace('TimeStepPrecision')
- register_types_ns3_TimeStepPrecision(nested_module)
-
-
## 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_internal(module):
+def register_types_ns3_Config(module):
root_module = module.get_root()
@@ -36,7 +36,7 @@ def register_types_ns3_TimeStepPrecision(module):
root_module = module.get_root()
-def register_types_ns3_Config(module):
+def register_types_ns3_internal(module):
root_module = module.get_root()
@@ -63,8 +63,13 @@ def register_types_ns3_olsr(module):
module.add_class('Tc', outer_class=root_module['ns3::olsr::MessageHeader'])
## olsr-header.h: ns3::olsr::PacketHeader [class]
module.add_class('PacketHeader', parent=root_module['ns3::Header'])
+ ## olsr-routing-table.h: ns3::olsr::RoutingTable [class]
+ module.add_class('RoutingTable', parent=root_module['ns3::Ipv4RoutingProtocol'])
+ ## olsr-routing-table.h: ns3::olsr::RoutingTableEntry [struct]
+ module.add_class('RoutingTableEntry')
module.add_container('std::vector< ns3::olsr::MessageHeader::Hello::LinkMessage >', 'ns3::olsr::MessageHeader::Hello::LinkMessage', container_type='vector')
module.add_container('std::vector< ns3::olsr::MessageHeader::Hna::Association >', 'ns3::olsr::MessageHeader::Hna::Association', container_type='vector')
+ module.add_container('std::vector< ns3::olsr::RoutingTableEntry >', 'ns3::olsr::RoutingTableEntry', container_type='vector')
def register_methods(root_module):
register_Ns3OlsrAgent_methods(root_module, root_module['ns3::olsr::Agent'])
@@ -76,6 +81,8 @@ def register_methods(root_module):
register_Ns3OlsrMessageHeaderMid_methods(root_module, root_module['ns3::olsr::MessageHeader::Mid'])
register_Ns3OlsrMessageHeaderTc_methods(root_module, root_module['ns3::olsr::MessageHeader::Tc'])
register_Ns3OlsrPacketHeader_methods(root_module, root_module['ns3::olsr::PacketHeader'])
+ register_Ns3OlsrRoutingTable_methods(root_module, root_module['ns3::olsr::RoutingTable'])
+ register_Ns3OlsrRoutingTableEntry_methods(root_module, root_module['ns3::olsr::RoutingTableEntry'])
return
def register_Ns3OlsrAgent_methods(root_module, cls):
@@ -103,6 +110,11 @@ def register_Ns3OlsrAgent_methods(root_module, cls):
'void',
[],
is_pure_virtual=True, is_virtual=True)
+ ## olsr-agent.h: ns3::Ptr ns3::olsr::Agent::GetRoutingTable() const [member function]
+ cls.add_method('GetRoutingTable',
+ 'ns3::Ptr< ns3::olsr::RoutingTable const >',
+ [],
+ is_pure_virtual=True, is_const=True, is_virtual=True)
return
def register_Ns3OlsrMessageHeader_methods(root_module, cls):
@@ -438,21 +450,102 @@ def register_Ns3OlsrPacketHeader_methods(root_module, cls):
[param('uint16_t', 'seqnum')])
return
+def register_Ns3OlsrRoutingTable_methods(root_module, cls):
+ ## olsr-routing-table.h: ns3::olsr::RoutingTable::RoutingTable(ns3::olsr::RoutingTable const & arg0) [copy constructor]
+ cls.add_constructor([param('ns3::olsr::RoutingTable const &', 'arg0')])
+ ## olsr-routing-table.h: ns3::olsr::RoutingTable::RoutingTable() [constructor]
+ cls.add_constructor([])
+ ## olsr-routing-table.h: void ns3::olsr::RoutingTable::SetIpv4(ns3::Ptr ipv4) [member function]
+ cls.add_method('SetIpv4',
+ 'void',
+ [param('ns3::Ptr< ns3::Ipv4 >', 'ipv4')])
+ ## olsr-routing-table.h: void ns3::olsr::RoutingTable::SetMainAddress(ns3::Ipv4Address mainAddress) [member function]
+ cls.add_method('SetMainAddress',
+ 'void',
+ [param('ns3::Ipv4Address', 'mainAddress')])
+ ## olsr-routing-table.h: void ns3::olsr::RoutingTable::Clear() [member function]
+ cls.add_method('Clear',
+ 'void',
+ [])
+ ## olsr-routing-table.h: uint32_t ns3::olsr::RoutingTable::GetSize() const [member function]
+ cls.add_method('GetSize',
+ 'uint32_t',
+ [],
+ is_const=True)
+ ## olsr-routing-table.h: std::vector > ns3::olsr::RoutingTable::GetEntries() const [member function]
+ cls.add_method('GetEntries',
+ 'std::vector< ns3::olsr::RoutingTableEntry >',
+ [],
+ is_const=True)
+ ## olsr-routing-table.h: void ns3::olsr::RoutingTable::RemoveEntry(ns3::Ipv4Address const & dest) [member function]
+ cls.add_method('RemoveEntry',
+ 'void',
+ [param('ns3::Ipv4Address const &', 'dest')])
+ ## olsr-routing-table.h: void ns3::olsr::RoutingTable::AddEntry(ns3::Ipv4Address const & dest, ns3::Ipv4Address const & next, uint32_t interface, uint32_t distance) [member function]
+ cls.add_method('AddEntry',
+ 'void',
+ [param('ns3::Ipv4Address const &', 'dest'), param('ns3::Ipv4Address const &', 'next'), param('uint32_t', 'interface'), param('uint32_t', 'distance')])
+ ## olsr-routing-table.h: void ns3::olsr::RoutingTable::AddEntry(ns3::Ipv4Address const & dest, ns3::Ipv4Address const & next, ns3::Ipv4Address const & interfaceAddress, uint32_t distance) [member function]
+ cls.add_method('AddEntry',
+ 'void',
+ [param('ns3::Ipv4Address const &', 'dest'), param('ns3::Ipv4Address const &', 'next'), param('ns3::Ipv4Address const &', 'interfaceAddress'), param('uint32_t', 'distance')])
+ ## olsr-routing-table.h: bool ns3::olsr::RoutingTable::Lookup(ns3::Ipv4Address const & dest, ns3::olsr::RoutingTableEntry & outEntry) const [member function]
+ cls.add_method('Lookup',
+ 'bool',
+ [param('ns3::Ipv4Address const &', 'dest'), param('ns3::olsr::RoutingTableEntry &', 'outEntry')],
+ is_const=True)
+ ## olsr-routing-table.h: bool ns3::olsr::RoutingTable::FindSendEntry(ns3::olsr::RoutingTableEntry const & entry, ns3::olsr::RoutingTableEntry & outEntry) const [member function]
+ cls.add_method('FindSendEntry',
+ 'bool',
+ [param('ns3::olsr::RoutingTableEntry const &', 'entry'), param('ns3::olsr::RoutingTableEntry &', 'outEntry')],
+ is_const=True)
+ ## olsr-routing-table.h: bool ns3::olsr::RoutingTable::RequestRoute(uint32_t ifIndex, ns3::Ipv4Header const & ipHeader, ns3::Ptr packet, ns3::Callback,const ns3::Ipv4Header&,ns3::empty,ns3::empty> routeReply) [member function]
+ cls.add_method('RequestRoute',
+ 'bool',
+ [param('uint32_t', 'ifIndex'), param('ns3::Ipv4Header const &', 'ipHeader'), param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Callback< void, bool, ns3::Ipv4Route const &, ns3::Ptr< ns3::Packet >, ns3::Ipv4Header const &, ns3::empty, ns3::empty >', 'routeReply')],
+ is_virtual=True)
+ ## olsr-routing-table.h: bool ns3::olsr::RoutingTable::RequestIfIndex(ns3::Ipv4Address destination, uint32_t & ifIndex) [member function]
+ cls.add_method('RequestIfIndex',
+ 'bool',
+ [param('ns3::Ipv4Address', 'destination'), param('uint32_t &', 'ifIndex')],
+ is_virtual=True)
+ ## olsr-routing-table.h: void ns3::olsr::RoutingTable::DoDispose() [member function]
+ cls.add_method('DoDispose',
+ 'void',
+ [],
+ visibility='private', is_virtual=True)
+ return
+
+def register_Ns3OlsrRoutingTableEntry_methods(root_module, cls):
+ ## olsr-routing-table.h: ns3::olsr::RoutingTableEntry::destAddr [variable]
+ cls.add_instance_attribute('destAddr', 'ns3::Ipv4Address', is_const=False)
+ ## olsr-routing-table.h: ns3::olsr::RoutingTableEntry::nextAddr [variable]
+ cls.add_instance_attribute('nextAddr', 'ns3::Ipv4Address', is_const=False)
+ ## olsr-routing-table.h: ns3::olsr::RoutingTableEntry::interface [variable]
+ cls.add_instance_attribute('interface', 'uint32_t', is_const=False)
+ ## olsr-routing-table.h: ns3::olsr::RoutingTableEntry::distance [variable]
+ cls.add_instance_attribute('distance', 'uint32_t', is_const=False)
+ ## olsr-routing-table.h: ns3::olsr::RoutingTableEntry::RoutingTableEntry(ns3::olsr::RoutingTableEntry const & arg0) [copy constructor]
+ cls.add_constructor([param('ns3::olsr::RoutingTableEntry const &', 'arg0')])
+ ## olsr-routing-table.h: ns3::olsr::RoutingTableEntry::RoutingTableEntry() [constructor]
+ cls.add_constructor([])
+ return
+
def register_functions(root_module):
module = root_module
- register_functions_ns3_internal(module.get_submodule('internal'), root_module)
- register_functions_ns3_TimeStepPrecision(module.get_submodule('TimeStepPrecision'), 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_internal(module, root_module):
+def register_functions_ns3_Config(module, root_module):
return
def register_functions_ns3_TimeStepPrecision(module, root_module):
return
-def register_functions_ns3_Config(module, root_module):
+def register_functions_ns3_internal(module, root_module):
return
def register_functions_ns3_olsr(module, root_module):
diff --git a/bindings/python/ns3_module_onoff.py b/bindings/python/ns3_module_onoff.py
index 57833a570..2d253ec6d 100644
--- a/bindings/python/ns3_module_onoff.py
+++ b/bindings/python/ns3_module_onoff.py
@@ -6,10 +6,10 @@ def register_types(module):
## onoff-application.h: ns3::OnOffApplication [class]
module.add_class('OnOffApplication', parent=root_module['ns3::Application'])
- ## Register a nested module for the namespace internal
+ ## Register a nested module for the namespace Config
- nested_module = module.add_cpp_namespace('internal')
- register_types_ns3_internal(nested_module)
+ nested_module = module.add_cpp_namespace('Config')
+ register_types_ns3_Config(nested_module)
## Register a nested module for the namespace TimeStepPrecision
@@ -18,10 +18,10 @@ def register_types(module):
register_types_ns3_TimeStepPrecision(nested_module)
- ## Register a nested module for the namespace Config
+ ## Register a nested module for the namespace internal
- nested_module = module.add_cpp_namespace('Config')
- register_types_ns3_Config(nested_module)
+ nested_module = module.add_cpp_namespace('internal')
+ register_types_ns3_internal(nested_module)
## Register a nested module for the namespace olsr
@@ -30,7 +30,7 @@ def register_types(module):
register_types_ns3_olsr(nested_module)
-def register_types_ns3_internal(module):
+def register_types_ns3_Config(module):
root_module = module.get_root()
@@ -38,7 +38,7 @@ def register_types_ns3_TimeStepPrecision(module):
root_module = module.get_root()
-def register_types_ns3_Config(module):
+def register_types_ns3_internal(module):
root_module = module.get_root()
@@ -83,21 +83,21 @@ def register_Ns3OnOffApplication_methods(root_module, cls):
def register_functions(root_module):
module = root_module
- register_functions_ns3_internal(module.get_submodule('internal'), root_module)
- register_functions_ns3_TimeStepPrecision(module.get_submodule('TimeStepPrecision'), 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_internal(module, root_module):
- return
-
-def register_functions_ns3_TimeStepPrecision(module, 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
diff --git a/bindings/python/ns3_module_packet_sink.py b/bindings/python/ns3_module_packet_sink.py
index 291f43a11..8478d79c4 100644
--- a/bindings/python/ns3_module_packet_sink.py
+++ b/bindings/python/ns3_module_packet_sink.py
@@ -6,10 +6,10 @@ def register_types(module):
## packet-sink.h: ns3::PacketSink [class]
module.add_class('PacketSink', parent=root_module['ns3::Application'])
- ## Register a nested module for the namespace internal
+ ## Register a nested module for the namespace Config
- nested_module = module.add_cpp_namespace('internal')
- register_types_ns3_internal(nested_module)
+ nested_module = module.add_cpp_namespace('Config')
+ register_types_ns3_Config(nested_module)
## Register a nested module for the namespace TimeStepPrecision
@@ -18,10 +18,10 @@ def register_types(module):
register_types_ns3_TimeStepPrecision(nested_module)
- ## Register a nested module for the namespace Config
+ ## Register a nested module for the namespace internal
- nested_module = module.add_cpp_namespace('Config')
- register_types_ns3_Config(nested_module)
+ nested_module = module.add_cpp_namespace('internal')
+ register_types_ns3_internal(nested_module)
## Register a nested module for the namespace olsr
@@ -30,7 +30,7 @@ def register_types(module):
register_types_ns3_olsr(nested_module)
-def register_types_ns3_internal(module):
+def register_types_ns3_Config(module):
root_module = module.get_root()
@@ -38,7 +38,7 @@ def register_types_ns3_TimeStepPrecision(module):
root_module = module.get_root()
-def register_types_ns3_Config(module):
+def register_types_ns3_internal(module):
root_module = module.get_root()
@@ -79,21 +79,21 @@ def register_Ns3PacketSink_methods(root_module, cls):
def register_functions(root_module):
module = root_module
- register_functions_ns3_internal(module.get_submodule('internal'), root_module)
- register_functions_ns3_TimeStepPrecision(module.get_submodule('TimeStepPrecision'), 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_internal(module, root_module):
- return
-
-def register_functions_ns3_TimeStepPrecision(module, 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
diff --git a/bindings/python/ns3_module_point_to_point.py b/bindings/python/ns3_module_point_to_point.py
index 0945ba6cc..c72ef165b 100644
--- a/bindings/python/ns3_module_point_to_point.py
+++ b/bindings/python/ns3_module_point_to_point.py
@@ -3,15 +3,17 @@ from pybindgen import Module, FileCodeSink, param, retval, cppclass
def register_types(module):
root_module = module.get_root()
+ ## ppp-header.h: ns3::PppHeader [class]
+ module.add_class('PppHeader', parent=root_module['ns3::Header'])
## point-to-point-channel.h: ns3::PointToPointChannel [class]
module.add_class('PointToPointChannel', parent=root_module['ns3::Channel'])
## point-to-point-net-device.h: ns3::PointToPointNetDevice [class]
module.add_class('PointToPointNetDevice', parent=root_module['ns3::NetDevice'])
- ## Register a nested module for the namespace internal
+ ## Register a nested module for the namespace Config
- nested_module = module.add_cpp_namespace('internal')
- register_types_ns3_internal(nested_module)
+ nested_module = module.add_cpp_namespace('Config')
+ register_types_ns3_Config(nested_module)
## Register a nested module for the namespace TimeStepPrecision
@@ -20,10 +22,10 @@ def register_types(module):
register_types_ns3_TimeStepPrecision(nested_module)
- ## Register a nested module for the namespace Config
+ ## Register a nested module for the namespace internal
- nested_module = module.add_cpp_namespace('Config')
- register_types_ns3_Config(nested_module)
+ nested_module = module.add_cpp_namespace('internal')
+ register_types_ns3_internal(nested_module)
## Register a nested module for the namespace olsr
@@ -32,7 +34,7 @@ def register_types(module):
register_types_ns3_olsr(nested_module)
-def register_types_ns3_internal(module):
+def register_types_ns3_Config(module):
root_module = module.get_root()
@@ -40,7 +42,7 @@ def register_types_ns3_TimeStepPrecision(module):
root_module = module.get_root()
-def register_types_ns3_Config(module):
+def register_types_ns3_internal(module):
root_module = module.get_root()
@@ -49,10 +51,48 @@ def register_types_ns3_olsr(module):
def register_methods(root_module):
+ register_Ns3PppHeader_methods(root_module, root_module['ns3::PppHeader'])
register_Ns3PointToPointChannel_methods(root_module, root_module['ns3::PointToPointChannel'])
register_Ns3PointToPointNetDevice_methods(root_module, root_module['ns3::PointToPointNetDevice'])
return
+def register_Ns3PppHeader_methods(root_module, cls):
+ ## ppp-header.h: ns3::PppHeader::PppHeader(ns3::PppHeader const & arg0) [copy constructor]
+ cls.add_constructor([param('ns3::PppHeader const &', 'arg0')])
+ ## ppp-header.h: ns3::PppHeader::PppHeader() [constructor]
+ cls.add_constructor([])
+ ## ppp-header.h: static ns3::TypeId ns3::PppHeader::GetTypeId() [member function]
+ cls.add_method('GetTypeId',
+ 'ns3::TypeId',
+ [],
+ is_static=True)
+ ## ppp-header.h: ns3::TypeId ns3::PppHeader::GetInstanceTypeId() const [member function]
+ cls.add_method('GetInstanceTypeId',
+ 'ns3::TypeId',
+ [],
+ is_const=True, is_virtual=True)
+ ## ppp-header.h: void ns3::PppHeader::Print(std::ostream & os) const [member function]
+ cls.add_method('Print',
+ 'void',
+ [param('std::ostream &', 'os')],
+ is_const=True, is_virtual=True)
+ ## ppp-header.h: void ns3::PppHeader::Serialize(ns3::Buffer::Iterator start) const [member function]
+ cls.add_method('Serialize',
+ 'void',
+ [param('ns3::Buffer::Iterator', 'start')],
+ is_const=True, is_virtual=True)
+ ## ppp-header.h: uint32_t ns3::PppHeader::Deserialize(ns3::Buffer::Iterator start) [member function]
+ cls.add_method('Deserialize',
+ 'uint32_t',
+ [param('ns3::Buffer::Iterator', 'start')],
+ is_virtual=True)
+ ## ppp-header.h: uint32_t ns3::PppHeader::GetSerializedSize() const [member function]
+ cls.add_method('GetSerializedSize',
+ 'uint32_t',
+ [],
+ is_const=True, is_virtual=True)
+ return
+
def register_Ns3PointToPointChannel_methods(root_module, cls):
## point-to-point-channel.h: ns3::PointToPointChannel::PointToPointChannel(ns3::PointToPointChannel const & arg0) [copy constructor]
cls.add_constructor([param('ns3::PointToPointChannel const &', 'arg0')])
@@ -200,13 +240,8 @@ def register_Ns3PointToPointNetDevice_methods(root_module, cls):
'bool',
[],
is_const=True, is_virtual=True)
- ## point-to-point-net-device.h: ns3::Address ns3::PointToPointNetDevice::GetMulticast() const [member function]
+ ## point-to-point-net-device.h: ns3::Address ns3::PointToPointNetDevice::GetMulticast(ns3::Ipv4Address multicastGroup) const [member function]
cls.add_method('GetMulticast',
- 'ns3::Address',
- [],
- is_const=True, is_virtual=True)
- ## point-to-point-net-device.h: ns3::Address ns3::PointToPointNetDevice::MakeMulticastAddress(ns3::Ipv4Address multicastGroup) const [member function]
- cls.add_method('MakeMulticastAddress',
'ns3::Address',
[param('ns3::Ipv4Address', 'multicastGroup')],
is_const=True, is_virtual=True)
@@ -245,6 +280,11 @@ def register_Ns3PointToPointNetDevice_methods(root_module, cls):
'void',
[param('ns3::Callback< bool, ns3::Ptr< ns3::NetDevice >, ns3::Ptr< ns3::Packet const >, unsigned short, ns3::Address const &, ns3::empty, ns3::empty >', 'cb')],
is_virtual=True)
+ ## point-to-point-net-device.h: ns3::Address ns3::PointToPointNetDevice::GetMulticast(ns3::Ipv6Address addr) const [member function]
+ cls.add_method('GetMulticast',
+ 'ns3::Address',
+ [param('ns3::Ipv6Address', 'addr')],
+ is_const=True, is_virtual=True)
## point-to-point-net-device.h: void ns3::PointToPointNetDevice::SetPromiscReceiveCallback(ns3::Callback, ns3::Ptr, unsigned short, ns3::Address const&, ns3::Address const&, ns3::NetDevice::PacketType> cb) [member function]
cls.add_method('SetPromiscReceiveCallback',
'void',
@@ -264,21 +304,21 @@ def register_Ns3PointToPointNetDevice_methods(root_module, cls):
def register_functions(root_module):
module = root_module
- register_functions_ns3_internal(module.get_submodule('internal'), root_module)
- register_functions_ns3_TimeStepPrecision(module.get_submodule('TimeStepPrecision'), 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_internal(module, root_module):
- return
-
-def register_functions_ns3_TimeStepPrecision(module, 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
diff --git a/bindings/python/ns3_module_simulator.py b/bindings/python/ns3_module_simulator.py
index 679733f08..72d683694 100644
--- a/bindings/python/ns3_module_simulator.py
+++ b/bindings/python/ns3_module_simulator.py
@@ -58,10 +58,10 @@ def register_types(module):
## realtime-simulator-impl.h: ns3::RealtimeSimulatorImpl::SynchronizationMode [enumeration]
module.add_enum('SynchronizationMode', ['SYNC_BEST_EFFORT', 'SYNC_HARD_LIMIT'], outer_class=root_module['ns3::RealtimeSimulatorImpl'])
- ## Register a nested module for the namespace internal
+ ## Register a nested module for the namespace Config
- nested_module = module.add_cpp_namespace('internal')
- register_types_ns3_internal(nested_module)
+ nested_module = module.add_cpp_namespace('Config')
+ register_types_ns3_Config(nested_module)
## Register a nested module for the namespace TimeStepPrecision
@@ -70,10 +70,10 @@ def register_types(module):
register_types_ns3_TimeStepPrecision(nested_module)
- ## Register a nested module for the namespace Config
+ ## Register a nested module for the namespace internal
- nested_module = module.add_cpp_namespace('Config')
- register_types_ns3_Config(nested_module)
+ nested_module = module.add_cpp_namespace('internal')
+ register_types_ns3_internal(nested_module)
## Register a nested module for the namespace olsr
@@ -82,7 +82,7 @@ def register_types(module):
register_types_ns3_olsr(nested_module)
-def register_types_ns3_internal(module):
+def register_types_ns3_Config(module):
root_module = module.get_root()
@@ -92,7 +92,7 @@ def register_types_ns3_TimeStepPrecision(module):
## nstime.h: ns3::TimeStepPrecision::precision_t [enumeration]
module.add_enum('precision_t', ['S', 'MS', 'US', 'NS', 'PS', 'FS'])
-def register_types_ns3_Config(module):
+def register_types_ns3_internal(module):
root_module = module.get_root()
@@ -1404,81 +1404,81 @@ def register_Ns3RealtimeSimulatorImpl_methods(root_module, cls):
def register_functions(root_module):
module = root_module
- ## high-precision.h: extern ns3::HighPrecision ns3::Max(ns3::HighPrecision const & a, ns3::HighPrecision const & b) [free function]
- module.add_function('Max',
- 'ns3::HighPrecision',
- [param('ns3::HighPrecision const &', 'a'), param('ns3::HighPrecision const &', 'b')])
- ## nstime.h: extern ns3::Time ns3::FemtoSeconds(uint64_t fs) [free function]
- module.add_function('FemtoSeconds',
- 'ns3::Time',
- [param('uint64_t', 'fs')])
- ## nstime.h: extern ns3::Time ns3::MicroSeconds(uint64_t us) [free function]
- module.add_function('MicroSeconds',
- 'ns3::Time',
- [param('uint64_t', 'us')])
- ## simulator.h: extern ns3::Time ns3::Now() [free function]
- module.add_function('Now',
- 'ns3::Time',
- [])
- ## nstime.h: extern ns3::Time ns3::MilliSeconds(uint64_t ms) [free function]
- module.add_function('MilliSeconds',
- 'ns3::Time',
- [param('uint64_t', 'ms')])
- ## nstime.h: extern ns3::Time ns3::NanoSeconds(uint64_t ns) [free function]
- module.add_function('NanoSeconds',
- 'ns3::Time',
- [param('uint64_t', 'ns')])
## high-precision.h: extern ns3::HighPrecision ns3::Abs(ns3::HighPrecision const & value) [free function]
module.add_function('Abs',
'ns3::HighPrecision',
[param('ns3::HighPrecision const &', 'value')])
- ## nstime.h: extern ns3::Ptr ns3::MakeTimeChecker() [free function]
- module.add_function('MakeTimeChecker',
- 'ns3::Ptr< ns3::AttributeChecker const >',
- [])
- ## nstime.h: extern ns3::Time ns3::Seconds(double seconds) [free function]
- module.add_function('Seconds',
+ ## nstime.h: extern ns3::Time ns3::FemtoSeconds(uint64_t fs) [free function]
+ module.add_function('FemtoSeconds',
'ns3::Time',
- [param('double', 'seconds')])
+ [param('uint64_t', 'fs')])
## make-event.h: extern ns3::EventImpl * ns3::MakeEvent(void (*)( ) * f) [free function]
module.add_function('MakeEvent',
'ns3::EventImpl *',
[param('void ( * ) ( ) *', 'f')])
- ## nstime.h: extern ns3::Time ns3::PicoSeconds(uint64_t ps) [free function]
- module.add_function('PicoSeconds',
+ ## nstime.h: extern ns3::Ptr ns3::MakeTimeChecker() [free function]
+ module.add_function('MakeTimeChecker',
+ 'ns3::Ptr< ns3::AttributeChecker const >',
+ [])
+ ## high-precision.h: extern ns3::HighPrecision ns3::Max(ns3::HighPrecision const & a, ns3::HighPrecision const & b) [free function]
+ module.add_function('Max',
+ 'ns3::HighPrecision',
+ [param('ns3::HighPrecision const &', 'a'), param('ns3::HighPrecision const &', 'b')])
+ ## nstime.h: extern ns3::Time ns3::MicroSeconds(uint64_t us) [free function]
+ module.add_function('MicroSeconds',
'ns3::Time',
- [param('uint64_t', 'ps')])
+ [param('uint64_t', 'us')])
+ ## nstime.h: extern ns3::Time ns3::MilliSeconds(uint64_t ms) [free function]
+ module.add_function('MilliSeconds',
+ 'ns3::Time',
+ [param('uint64_t', 'ms')])
## high-precision.h: extern ns3::HighPrecision ns3::Min(ns3::HighPrecision const & a, ns3::HighPrecision const & b) [free function]
module.add_function('Min',
'ns3::HighPrecision',
[param('ns3::HighPrecision const &', 'a'), param('ns3::HighPrecision const &', 'b')])
+ ## nstime.h: extern ns3::Time ns3::NanoSeconds(uint64_t ns) [free function]
+ module.add_function('NanoSeconds',
+ 'ns3::Time',
+ [param('uint64_t', 'ns')])
+ ## simulator.h: extern ns3::Time ns3::Now() [free function]
+ module.add_function('Now',
+ 'ns3::Time',
+ [])
+ ## nstime.h: extern ns3::Time ns3::PicoSeconds(uint64_t ps) [free function]
+ module.add_function('PicoSeconds',
+ 'ns3::Time',
+ [param('uint64_t', 'ps')])
+ ## nstime.h: extern ns3::Time ns3::Seconds(double seconds) [free function]
+ module.add_function('Seconds',
+ 'ns3::Time',
+ [param('double', 'seconds')])
## nstime.h: extern ns3::Time ns3::TimeStep(uint64_t ts) [free function]
module.add_function('TimeStep',
'ns3::Time',
[param('uint64_t', 'ts')])
- register_functions_ns3_internal(module.get_submodule('internal'), root_module)
- register_functions_ns3_TimeStepPrecision(module.get_submodule('TimeStepPrecision'), 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_internal(module, root_module):
- return
-
-def register_functions_ns3_TimeStepPrecision(module, root_module):
- ## nstime.h: extern void ns3::TimeStepPrecision::Set(ns3::TimeStepPrecision::precision_t precision) [free function]
- module.add_function('Set',
- 'void',
- [param('ns3::TimeStepPrecision::precision_t', 'precision')])
- ## nstime.h: extern ns3::TimeStepPrecision::precision_t ns3::TimeStepPrecision::Get() [free function]
- module.add_function('Get',
- 'ns3::TimeStepPrecision::precision_t',
- [])
- return
-
def register_functions_ns3_Config(module, root_module):
return
+def register_functions_ns3_TimeStepPrecision(module, root_module):
+ ## nstime.h: extern ns3::TimeStepPrecision::precision_t ns3::TimeStepPrecision::Get() [free function]
+ module.add_function('Get',
+ 'ns3::TimeStepPrecision::precision_t',
+ [])
+ ## nstime.h: extern void ns3::TimeStepPrecision::Set(ns3::TimeStepPrecision::precision_t precision) [free function]
+ module.add_function('Set',
+ 'void',
+ [param('ns3::TimeStepPrecision::precision_t', 'precision')])
+ return
+
+def register_functions_ns3_internal(module, root_module):
+ return
+
def register_functions_ns3_olsr(module, root_module):
return
diff --git a/bindings/python/ns3_module_stats.py b/bindings/python/ns3_module_stats.py
index 21503c2a0..6da736fe1 100644
--- a/bindings/python/ns3_module_stats.py
+++ b/bindings/python/ns3_module_stats.py
@@ -26,10 +26,10 @@ def register_types(module):
## packet-data-calculators.h: ns3::PacketCounterCalculator [class]
module.add_class('PacketCounterCalculator', parent=root_module['ns3::CounterCalculator< unsigned int >'])
- ## Register a nested module for the namespace internal
+ ## Register a nested module for the namespace Config
- nested_module = module.add_cpp_namespace('internal')
- register_types_ns3_internal(nested_module)
+ nested_module = module.add_cpp_namespace('Config')
+ register_types_ns3_Config(nested_module)
## Register a nested module for the namespace TimeStepPrecision
@@ -38,10 +38,10 @@ def register_types(module):
register_types_ns3_TimeStepPrecision(nested_module)
- ## Register a nested module for the namespace Config
+ ## Register a nested module for the namespace internal
- nested_module = module.add_cpp_namespace('Config')
- register_types_ns3_Config(nested_module)
+ nested_module = module.add_cpp_namespace('internal')
+ register_types_ns3_internal(nested_module)
## Register a nested module for the namespace olsr
@@ -50,7 +50,7 @@ def register_types(module):
register_types_ns3_olsr(nested_module)
-def register_types_ns3_internal(module):
+def register_types_ns3_Config(module):
root_module = module.get_root()
@@ -58,7 +58,7 @@ def register_types_ns3_TimeStepPrecision(module):
root_module = module.get_root()
-def register_types_ns3_Config(module):
+def register_types_ns3_internal(module):
root_module = module.get_root()
@@ -417,21 +417,21 @@ def register_Ns3PacketCounterCalculator_methods(root_module, cls):
def register_functions(root_module):
module = root_module
- register_functions_ns3_internal(module.get_submodule('internal'), root_module)
- register_functions_ns3_TimeStepPrecision(module.get_submodule('TimeStepPrecision'), 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_internal(module, root_module):
- return
-
-def register_functions_ns3_TimeStepPrecision(module, 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
diff --git a/bindings/python/ns3_module_udp_echo.py b/bindings/python/ns3_module_udp_echo.py
index c4fb73c46..dae92a56e 100644
--- a/bindings/python/ns3_module_udp_echo.py
+++ b/bindings/python/ns3_module_udp_echo.py
@@ -8,10 +8,10 @@ def register_types(module):
## udp-echo-server.h: ns3::UdpEchoServer [class]
module.add_class('UdpEchoServer', parent=root_module['ns3::Application'])
- ## Register a nested module for the namespace internal
+ ## Register a nested module for the namespace Config
- nested_module = module.add_cpp_namespace('internal')
- register_types_ns3_internal(nested_module)
+ nested_module = module.add_cpp_namespace('Config')
+ register_types_ns3_Config(nested_module)
## Register a nested module for the namespace TimeStepPrecision
@@ -20,10 +20,10 @@ def register_types(module):
register_types_ns3_TimeStepPrecision(nested_module)
- ## Register a nested module for the namespace Config
+ ## Register a nested module for the namespace internal
- nested_module = module.add_cpp_namespace('Config')
- register_types_ns3_Config(nested_module)
+ nested_module = module.add_cpp_namespace('internal')
+ register_types_ns3_internal(nested_module)
## Register a nested module for the namespace olsr
@@ -32,7 +32,7 @@ def register_types(module):
register_types_ns3_olsr(nested_module)
-def register_types_ns3_internal(module):
+def register_types_ns3_Config(module):
root_module = module.get_root()
@@ -40,7 +40,7 @@ def register_types_ns3_TimeStepPrecision(module):
root_module = module.get_root()
-def register_types_ns3_Config(module):
+def register_types_ns3_internal(module):
root_module = module.get_root()
@@ -113,21 +113,21 @@ def register_Ns3UdpEchoServer_methods(root_module, cls):
def register_functions(root_module):
module = root_module
- register_functions_ns3_internal(module.get_submodule('internal'), root_module)
- register_functions_ns3_TimeStepPrecision(module.get_submodule('TimeStepPrecision'), 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_internal(module, root_module):
- return
-
-def register_functions_ns3_TimeStepPrecision(module, 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
diff --git a/bindings/python/ns3_module_v4ping.py b/bindings/python/ns3_module_v4ping.py
new file mode 100644
index 000000000..ec2bc2357
--- /dev/null
+++ b/bindings/python/ns3_module_v4ping.py
@@ -0,0 +1,99 @@
+from pybindgen import Module, FileCodeSink, param, retval, cppclass
+
+def register_types(module):
+ root_module = module.get_root()
+
+ ## v4ping.h: ns3::V4Ping [class]
+ module.add_class('V4Ping', parent=root_module['ns3::Application'])
+
+ ## Register a nested module for the namespace Config
+
+ nested_module = module.add_cpp_namespace('Config')
+ register_types_ns3_Config(nested_module)
+
+
+ ## Register a nested module for the namespace TimeStepPrecision
+
+ nested_module = module.add_cpp_namespace('TimeStepPrecision')
+ register_types_ns3_TimeStepPrecision(nested_module)
+
+
+ ## Register a nested module for the namespace 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_Ns3V4Ping_methods(root_module, root_module['ns3::V4Ping'])
+ return
+
+def register_Ns3V4Ping_methods(root_module, cls):
+ ## v4ping.h: ns3::V4Ping::V4Ping(ns3::V4Ping const & arg0) [copy constructor]
+ cls.add_constructor([param('ns3::V4Ping const &', 'arg0')])
+ ## v4ping.h: static ns3::TypeId ns3::V4Ping::GetTypeId() [member function]
+ cls.add_method('GetTypeId',
+ 'ns3::TypeId',
+ [],
+ is_static=True)
+ ## v4ping.h: ns3::V4Ping::V4Ping() [constructor]
+ cls.add_constructor([])
+ ## v4ping.h: void ns3::V4Ping::StartApplication() [member function]
+ cls.add_method('StartApplication',
+ 'void',
+ [],
+ visibility='private', is_virtual=True)
+ ## v4ping.h: void ns3::V4Ping::StopApplication() [member function]
+ cls.add_method('StopApplication',
+ 'void',
+ [],
+ visibility='private', is_virtual=True)
+ ## v4ping.h: void ns3::V4Ping::DoDispose() [member function]
+ cls.add_method('DoDispose',
+ 'void',
+ [],
+ visibility='private', is_virtual=True)
+ return
+
+def register_functions(root_module):
+ module = root_module
+ register_functions_ns3_Config(module.get_submodule('Config'), root_module)
+ register_functions_ns3_TimeStepPrecision(module.get_submodule('TimeStepPrecision'), root_module)
+ register_functions_ns3_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
+
diff --git a/bindings/python/ns3_module_wifi.py b/bindings/python/ns3_module_wifi.py
index 4b4b2e4c8..99c61cdfb 100644
--- a/bindings/python/ns3_module_wifi.py
+++ b/bindings/python/ns3_module_wifi.py
@@ -104,10 +104,10 @@ def register_types(module):
## aarf-wifi-manager.h: ns3::AarfWifiManager [class]
module.add_class('AarfWifiManager', parent=root_module['ns3::ArfWifiManager'])
- ## Register a nested module for the namespace internal
+ ## Register a nested module for the namespace Config
- nested_module = module.add_cpp_namespace('internal')
- register_types_ns3_internal(nested_module)
+ nested_module = module.add_cpp_namespace('Config')
+ register_types_ns3_Config(nested_module)
## Register a nested module for the namespace TimeStepPrecision
@@ -116,10 +116,10 @@ def register_types(module):
register_types_ns3_TimeStepPrecision(nested_module)
- ## Register a nested module for the namespace Config
+ ## Register a nested module for the namespace internal
- nested_module = module.add_cpp_namespace('Config')
- register_types_ns3_Config(nested_module)
+ nested_module = module.add_cpp_namespace('internal')
+ register_types_ns3_internal(nested_module)
## Register a nested module for the namespace olsr
@@ -128,7 +128,7 @@ def register_types(module):
register_types_ns3_olsr(nested_module)
-def register_types_ns3_internal(module):
+def register_types_ns3_Config(module):
root_module = module.get_root()
@@ -136,7 +136,7 @@ def register_types_ns3_TimeStepPrecision(module):
root_module = module.get_root()
-def register_types_ns3_Config(module):
+def register_types_ns3_internal(module):
root_module = module.get_root()
@@ -2669,13 +2669,8 @@ def register_Ns3WifiNetDevice_methods(root_module, cls):
'bool',
[],
is_const=True, is_virtual=True)
- ## wifi-net-device.h: ns3::Address ns3::WifiNetDevice::GetMulticast() const [member function]
+ ## wifi-net-device.h: ns3::Address ns3::WifiNetDevice::GetMulticast(ns3::Ipv4Address multicastGroup) const [member function]
cls.add_method('GetMulticast',
- 'ns3::Address',
- [],
- is_const=True, is_virtual=True)
- ## wifi-net-device.h: ns3::Address ns3::WifiNetDevice::MakeMulticastAddress(ns3::Ipv4Address multicastGroup) const [member function]
- cls.add_method('MakeMulticastAddress',
'ns3::Address',
[param('ns3::Ipv4Address', 'multicastGroup')],
is_const=True, is_virtual=True)
@@ -2709,6 +2704,11 @@ def register_Ns3WifiNetDevice_methods(root_module, cls):
'void',
[param('ns3::Callback< bool, ns3::Ptr< ns3::NetDevice >, ns3::Ptr< ns3::Packet const >, unsigned short, ns3::Address const &, ns3::empty, ns3::empty >', 'cb')],
is_virtual=True)
+ ## wifi-net-device.h: ns3::Address ns3::WifiNetDevice::GetMulticast(ns3::Ipv6Address addr) const [member function]
+ cls.add_method('GetMulticast',
+ 'ns3::Address',
+ [param('ns3::Ipv6Address', 'addr')],
+ is_const=True, is_virtual=True)
## wifi-net-device.h: bool ns3::WifiNetDevice::SendFrom(ns3::Ptr packet, ns3::Address const & source, ns3::Address const & dest, uint16_t protocolNumber) [member function]
cls.add_method('SendFrom',
'bool',
@@ -2789,29 +2789,29 @@ def register_Ns3AarfWifiManager_methods(root_module, cls):
def register_functions(root_module):
module = root_module
- ## wifi-mode.h: extern ns3::Ptr ns3::MakeWifiModeChecker() [free function]
- module.add_function('MakeWifiModeChecker',
- 'ns3::Ptr< ns3::AttributeChecker const >',
- [])
## ssid.h: extern ns3::Ptr ns3::MakeSsidChecker() [free function]
module.add_function('MakeSsidChecker',
'ns3::Ptr< ns3::AttributeChecker const >',
[])
- register_functions_ns3_internal(module.get_submodule('internal'), root_module)
- register_functions_ns3_TimeStepPrecision(module.get_submodule('TimeStepPrecision'), root_module)
+ ## wifi-mode.h: extern ns3::Ptr ns3::MakeWifiModeChecker() [free function]
+ module.add_function('MakeWifiModeChecker',
+ 'ns3::Ptr< ns3::AttributeChecker const >',
+ [])
register_functions_ns3_Config(module.get_submodule('Config'), root_module)
+ register_functions_ns3_TimeStepPrecision(module.get_submodule('TimeStepPrecision'), root_module)
+ register_functions_ns3_internal(module.get_submodule('internal'), root_module)
register_functions_ns3_olsr(module.get_submodule('olsr'), root_module)
return
-def register_functions_ns3_internal(module, root_module):
- return
-
-def register_functions_ns3_TimeStepPrecision(module, 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
diff --git a/bindings/python/ns3modulegen_generated.py b/bindings/python/ns3modulegen_generated.py
index c2aad704d..8212f6548 100644
--- a/bindings/python/ns3modulegen_generated.py
+++ b/bindings/python/ns3modulegen_generated.py
@@ -23,8 +23,10 @@ import ns3_module_stats
import ns3_module_internet_stack
import ns3_module_wifi
import ns3_module_csma
+import ns3_module_emu
import ns3_module_bridge
import ns3_module_packet_sink
+import ns3_module_v4ping
import ns3_module_global_routing
import ns3_module_onoff
import ns3_module_olsr
@@ -159,6 +161,17 @@ def register_types(module):
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_bridge')
ns3_module_bridge.register_types(module)
@@ -181,6 +194,17 @@ def register_types(module):
ns3_module_packet_sink__local.register_types(module)
root_module.end_section('ns3_module_packet_sink')
+ root_module.begin_section('ns3_module_v4ping')
+ ns3_module_v4ping.register_types(module)
+
+ try:
+ import ns3_module_v4ping__local
+ except ImportError:
+ pass
+ else:
+ ns3_module_v4ping__local.register_types(module)
+
+ root_module.end_section('ns3_module_v4ping')
root_module.begin_section('ns3_module_global_routing')
ns3_module_global_routing.register_types(module)
@@ -239,10 +263,10 @@ def register_types(module):
module.add_container('std::vector< unsigned int >', 'unsigned int', container_type='vector')
module.add_container('std::list< unsigned int >', 'unsigned int', container_type='list')
- ## Register a nested module for the namespace internal
+ ## Register a nested module for the namespace Config
- nested_module = module.add_cpp_namespace('internal')
- register_types_ns3_internal(nested_module)
+ nested_module = module.add_cpp_namespace('Config')
+ register_types_ns3_Config(nested_module)
## Register a nested module for the namespace TimeStepPrecision
@@ -251,10 +275,10 @@ def register_types(module):
register_types_ns3_TimeStepPrecision(nested_module)
- ## Register a nested module for the namespace Config
+ ## Register a nested module for the namespace internal
- nested_module = module.add_cpp_namespace('Config')
- register_types_ns3_Config(nested_module)
+ nested_module = module.add_cpp_namespace('internal')
+ register_types_ns3_internal(nested_module)
## Register a nested module for the namespace olsr
@@ -263,18 +287,18 @@ def register_types(module):
register_types_ns3_olsr(nested_module)
-def register_types_ns3_internal(module):
+def register_types_ns3_Config(module):
root_module = module.get_root()
+ module.add_container('std::vector< std::string >', 'std::string', container_type='vector')
def register_types_ns3_TimeStepPrecision(module):
root_module = module.get_root()
-def register_types_ns3_Config(module):
+def register_types_ns3_internal(module):
root_module = module.get_root()
- module.add_container('std::vector< std::string >', 'std::string', container_type='vector')
def register_types_ns3_olsr(module):
root_module = module.get_root()
@@ -402,6 +426,17 @@ def register_methods(root_module):
ns3_module_csma__local.register_methods(root_module)
root_module.end_section('ns3_module_csma')
+ root_module.begin_section('ns3_module_emu')
+ ns3_module_emu.register_methods(root_module)
+
+ try:
+ import ns3_module_emu__local
+ except ImportError:
+ pass
+ else:
+ ns3_module_emu__local.register_methods(root_module)
+
+ root_module.end_section('ns3_module_emu')
root_module.begin_section('ns3_module_bridge')
ns3_module_bridge.register_methods(root_module)
@@ -424,6 +459,17 @@ def register_methods(root_module):
ns3_module_packet_sink__local.register_methods(root_module)
root_module.end_section('ns3_module_packet_sink')
+ root_module.begin_section('ns3_module_v4ping')
+ ns3_module_v4ping.register_methods(root_module)
+
+ try:
+ import ns3_module_v4ping__local
+ except ImportError:
+ pass
+ else:
+ ns3_module_v4ping__local.register_methods(root_module)
+
+ root_module.end_section('ns3_module_v4ping')
root_module.begin_section('ns3_module_global_routing')
ns3_module_global_routing.register_methods(root_module)
@@ -604,6 +650,17 @@ def register_functions(root_module):
ns3_module_csma__local.register_functions(root_module)
root_module.end_section('ns3_module_csma')
+ root_module.begin_section('ns3_module_emu')
+ ns3_module_emu.register_functions(root_module)
+
+ try:
+ import ns3_module_emu__local
+ except ImportError:
+ pass
+ else:
+ ns3_module_emu__local.register_functions(root_module)
+
+ root_module.end_section('ns3_module_emu')
root_module.begin_section('ns3_module_bridge')
ns3_module_bridge.register_functions(root_module)
@@ -626,6 +683,17 @@ def register_functions(root_module):
ns3_module_packet_sink__local.register_functions(root_module)
root_module.end_section('ns3_module_packet_sink')
+ root_module.begin_section('ns3_module_v4ping')
+ ns3_module_v4ping.register_functions(root_module)
+
+ try:
+ import ns3_module_v4ping__local
+ except ImportError:
+ pass
+ else:
+ ns3_module_v4ping__local.register_functions(root_module)
+
+ root_module.end_section('ns3_module_v4ping')
root_module.begin_section('ns3_module_global_routing')
ns3_module_global_routing.register_functions(root_module)
@@ -681,19 +749,19 @@ def register_functions(root_module):
ns3_module_helper__local.register_functions(root_module)
root_module.end_section('ns3_module_helper')
- register_functions_ns3_internal(module.get_submodule('internal'), root_module)
- register_functions_ns3_TimeStepPrecision(module.get_submodule('TimeStepPrecision'), 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_internal(module, root_module):
+def register_functions_ns3_Config(module, root_module):
return
def register_functions_ns3_TimeStepPrecision(module, root_module):
return
-def register_functions_ns3_Config(module, root_module):
+def register_functions_ns3_internal(module, root_module):
return
def register_functions_ns3_olsr(module, root_module):
diff --git a/bindings/python/wscript b/bindings/python/wscript
index 4efa378e8..db0f71b7f 100644
--- a/bindings/python/wscript
+++ b/bindings/python/wscript
@@ -16,16 +16,25 @@ import sys
LOCAL_PYBINDGEN_PATH = os.path.join(os.getcwd(), "bindings", "python", "pybindgen")
#PYBINDGEN_BRANCH = 'lp:pybindgen'
PYBINDGEN_BRANCH = 'https://launchpad.net/pybindgen'
-if os.environ.get('PYTHONPATH', ''):
- os.environ['PYTHONPATH'] = LOCAL_PYBINDGEN_PATH + os.pathsep + os.environ.get('PYTHONPATH')
-else:
- os.environ['PYTHONPATH'] = LOCAL_PYBINDGEN_PATH
## https://launchpad.net/pybindgen/
-REQUIRED_PYBINDGEN_VERSION = (0, 9, 0, 600)
+REQUIRED_PYBINDGEN_VERSION = (0, 9, 0, 605)
REQUIRED_PYGCCXML_VERSION = (0, 9, 5)
+def add_to_python_path(path):
+ if os.environ.get('PYTHONPATH', ''):
+ os.environ['PYTHONPATH'] = path + os.pathsep + os.environ.get('PYTHONPATH')
+ else:
+ os.environ['PYTHONPATH'] = path
+
+def set_pybindgen_pythonpath(env):
+ if env['WITH_PYBINDGEN']:
+ add_to_python_path(env['WITH_PYBINDGEN'])
+ else:
+ add_to_python_path(LOCAL_PYBINDGEN_PATH)
+
+
def set_options(opt):
opt.tool_options('python')
opt.add_option('--disable-python',
@@ -41,6 +50,10 @@ def set_options(opt):
"instead of using the system installed version."),
action="store_true", default=False,
dest='pybindgen_checkout')
+ opt.add_option('--with-pybindgen',
+ help=('Path to an existing pybindgen source tree to use.'),
+ default=None,
+ dest='with_pybindgen', type="string")
def fetch_pybindgen(conf):
"""
@@ -118,15 +131,31 @@ def configure(conf):
conf.report_optional_feature("python", "Python Bindings", False, str(ex))
return
+ # Fix a bug with WAF and g++ 4.3.2 (it does not include "(GCC") in
+ # the output of g++ --version, so the WAF python detection fails
+ # to recognize it is gcc)
+ gcc_version = os.popen("%s --version" % conf.env['CXX']).readline()
+ if '(GCC)' in gcc_version or 'g++' in gcc_version:
+ conf.env.append_value('CXXFLAGS_PYEMBED','-fno-strict-aliasing')
+ conf.env.append_value('CXXFLAGS_PYEXT','-fno-strict-aliasing')
+
## Check for pybindgen
+
+ no_net = False
+ if Params.g_options.with_pybindgen:
+ conf.env['WITH_PYBINDGEN'] = os.path.abspath(Params.g_options.with_pybindgen)
+ no_net = True
+
if Params.g_options.pybindgen_checkout:
fetch_pybindgen(conf)
+ set_pybindgen_pythonpath(conf.env)
+
try:
conf.check_python_module('pybindgen')
except Configure.ConfigurationError:
warning("pybindgen missing")
- if not fetch_pybindgen(conf):
+ if no_net or not fetch_pybindgen(conf):
conf.report_optional_feature("python", "Python Bindings", False,
"PyBindGen missing and could not be retrieved")
return
@@ -144,7 +173,7 @@ def configure(conf):
warning("pybindgen (found %s) is too old (need %s)" %
(pybindgen_version_str,
'.'.join([str(x) for x in REQUIRED_PYBINDGEN_VERSION])))
- if not fetch_pybindgen(conf):
+ if no_net or not fetch_pybindgen(conf):
conf.report_optional_feature("python", "Python Bindings", False,
"PyBindGen too old and newer version could not be retrieved")
return
@@ -383,6 +412,8 @@ def build(bld):
env = bld.env_of_name('default')
curdir = bld.m_curdirnode.abspath()
+ set_pybindgen_pythonpath(env)
+
#Object.register('all-ns3-headers', AllNs3Headers)
Action.Action('gen-ns3-metaheader', func=gen_ns3_metaheader, color='BLUE')
diff --git a/examples/csma-ping.cc b/examples/csma-ping.cc
new file mode 100644
index 000000000..ffddd9c6f
--- /dev/null
+++ b/examples/csma-ping.cc
@@ -0,0 +1,140 @@
+/* -*- 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
+ */
+
+// Port of ns-2/tcl/ex/simple.tcl to ns-3
+//
+// Network topology
+//
+// n0 n1 n2 n3
+// | | | |
+// =====================
+//
+// - CBR/UDP flows from n0 to n1, and from n3 to n0
+// - UDP packet size of 210 bytes, with per-packet interval 0.00375 sec.
+// (i.e., DataRate of 448,000 bps)
+// - DropTail queues
+// - Tracing of queues and packet receptions to file "csma-one-subnet.tr"
+
+#include
+#include
+#include
+#include
+
+#include "ns3/core-module.h"
+#include "ns3/simulator-module.h"
+#include "ns3/node-module.h"
+#include "ns3/helper-module.h"
+#include "ns3/global-route-manager.h"
+
+using namespace ns3;
+
+NS_LOG_COMPONENT_DEFINE ("CsmaPingExample");
+
+static void SinkRx (Ptr p, const Address &ad)
+{
+ //std::cout << *p << std::endl;
+}
+
+static void PingRtt (std::string context, Time rtt)
+{
+ //std::cout << context << " " << rtt << std::endl;
+}
+
+int
+main (int argc, char *argv[])
+{
+ //
+ // Make the random number generators generate reproducible results.
+ //
+ RandomVariable::UseGlobalSeed (1, 1, 2, 3, 5, 8);
+
+ CommandLine cmd;
+ cmd.Parse (argc, argv);
+
+ // Here, we will explicitly create four nodes.
+ NS_LOG_INFO ("Create nodes.");
+ NodeContainer c;
+ c.Create (4);
+
+ // connect all our nodes to a shared channel.
+ NS_LOG_INFO ("Build Topology.");
+ CsmaHelper csma;
+ csma.SetChannelAttribute ("DataRate", DataRateValue (DataRate (5000000)));
+ csma.SetChannelAttribute ("Delay", TimeValue (MilliSeconds (2)));
+ csma.SetDeviceAttribute ("EncapsulationMode", StringValue ("Llc"));
+ NetDeviceContainer devs = csma.Install (c);
+
+ // add an ip stack to all nodes.
+ NS_LOG_INFO ("Add ip stack.");
+ InternetStackHelper ipStack;
+ ipStack.Install (c);
+
+ // assign ip addresses
+ NS_LOG_INFO ("Assign ip addresses.");
+ Ipv4AddressHelper ip;
+ ip.SetBase ("192.168.1.0", "255.255.255.0");
+ Ipv4InterfaceContainer addresses = ip.Assign (devs);
+
+ // setup global router
+ GlobalRouteManager::PopulateRoutingTables ();
+ NS_LOG_INFO ("Create Source");
+ Config::SetDefault ("ns3::Ipv4RawSocketImpl::Protocol", StringValue ("2"));
+ InetSocketAddress dst = InetSocketAddress (addresses.GetAddress (3));
+ OnOffHelper onoff = OnOffHelper ("ns3::Ipv4RawSocketFactory", dst);
+ onoff.SetAttribute ("OnTime", RandomVariableValue (ConstantVariable (1.0)));
+ onoff.SetAttribute ("OffTime", RandomVariableValue (ConstantVariable (0.0)));
+ onoff.SetAttribute ("DataRate", DataRateValue (DataRate (15000)));
+ onoff.SetAttribute ("PacketSize", UintegerValue (1200));
+
+
+ ApplicationContainer apps = onoff.Install (c.Get (0));
+ apps.Start (Seconds (1.0));
+ apps.Stop (Seconds (10.0));
+
+ NS_LOG_INFO ("Create Sink.");
+ PacketSinkHelper sink = PacketSinkHelper ("ns3::Ipv4RawSocketFactory", dst);
+ apps = sink.Install (c.Get (3));
+ apps.Start (Seconds (0.0));
+ apps.Stop (Seconds (11.0));
+
+ NS_LOG_INFO ("Create pinger");
+ V4PingHelper ping = V4PingHelper (addresses.GetAddress (2));
+ NodeContainer pingers;
+ pingers.Add (c.Get (0));
+ pingers.Add (c.Get (1));
+ pingers.Add (c.Get (3));
+ apps = ping.Install (pingers);
+ apps.Start (Seconds (2.0));
+ apps.Stop (Seconds (5.0));
+
+ NS_LOG_INFO ("Configure Tracing.");
+ // first, pcap tracing.
+ csma.EnablePcapAll ("csma-ping");
+ // then, print what the packet sink receives.
+ Config::ConnectWithoutContext ("/NodeList/3/ApplicationList/0/$ns3::PacketSink/Rx",
+ MakeCallback (&SinkRx));
+ // finally, print the ping rtts.
+ Config::Connect ("/NodeList/*/ApplicationList/*/$ns3::V4Ping/Rtt",
+ MakeCallback (&PingRtt));
+
+ Packet::EnablePrinting ();
+
+
+ NS_LOG_INFO ("Run Simulation.");
+ Simulator::Run ();
+ Simulator::Destroy ();
+ NS_LOG_INFO ("Done.");
+}
diff --git a/examples/csma-raw-ip-socket.cc b/examples/csma-raw-ip-socket.cc
new file mode 100644
index 000000000..37f4dab51
--- /dev/null
+++ b/examples/csma-raw-ip-socket.cc
@@ -0,0 +1,122 @@
+/* -*- 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
+ */
+
+// Port of ns-2/tcl/ex/simple.tcl to ns-3
+//
+// Network topology
+//
+// n0 n1 n2 n3
+// | | | |
+// =====================
+//
+// - CBR/UDP flows from n0 to n1, and from n3 to n0
+// - UDP packet size of 210 bytes, with per-packet interval 0.00375 sec.
+// (i.e., DataRate of 448,000 bps)
+// - DropTail queues
+// - Tracing of queues and packet receptions to file "csma-one-subnet.tr"
+
+#include
+#include
+#include
+#include
+
+#include "ns3/core-module.h"
+#include "ns3/simulator-module.h"
+#include "ns3/node-module.h"
+#include "ns3/helper-module.h"
+
+using namespace ns3;
+
+NS_LOG_COMPONENT_DEFINE ("CsmaPacketSocketExample");
+
+static void SinkRx (Ptr p, const Address &ad)
+{
+ //std::cout << *p << std::endl;
+}
+
+int
+main (int argc, char *argv[])
+{
+#if 0
+ LogComponentEnable ("CsmaPacketSocketExample", LOG_LEVEL_INFO);
+#endif
+
+ //
+ // Make the random number generators generate reproducible results.
+ //
+ RandomVariable::UseGlobalSeed (1, 1, 2, 3, 5, 8);
+
+ CommandLine cmd;
+ cmd.Parse (argc, argv);
+
+ // Here, we will explicitly create four nodes.
+ NS_LOG_INFO ("Create nodes.");
+ NodeContainer c;
+ c.Create (4);
+
+ // connect all our nodes to a shared channel.
+ NS_LOG_INFO ("Build Topology.");
+ CsmaHelper csma;
+ csma.SetChannelAttribute ("DataRate", DataRateValue (DataRate (5000000)));
+ csma.SetChannelAttribute ("Delay", TimeValue (MilliSeconds (2)));
+ csma.SetDeviceAttribute ("EncapsulationMode", StringValue ("Llc"));
+ NetDeviceContainer devs = csma.Install (c);
+
+ // add an ip stack to all nodes.
+ NS_LOG_INFO ("Add ip stack.");
+ InternetStackHelper ipStack;
+ ipStack.Install (c);
+
+ // assign ip addresses
+ NS_LOG_INFO ("Assign ip addresses.");
+ Ipv4AddressHelper ip;
+ ip.SetBase ("192.168.1.0", "255.255.255.0");
+ Ipv4InterfaceContainer addresses = ip.Assign (devs);
+
+ NS_LOG_INFO ("Create Source");
+ Config::SetDefault ("ns3::Ipv4RawSocketImpl::Protocol", StringValue ("2"));
+ InetSocketAddress dst = InetSocketAddress (addresses.GetAddress (3));
+ OnOffHelper onoff = OnOffHelper ("ns3::Ipv4RawSocketFactory", dst);
+ onoff.SetAttribute ("OnTime", RandomVariableValue (ConstantVariable (1.0)));
+ onoff.SetAttribute ("OffTime", RandomVariableValue (ConstantVariable (0.0)));
+ onoff.SetAttribute ("DataRate", DataRateValue (DataRate (6000)));
+ onoff.SetAttribute ("PacketSize", UintegerValue (1200));
+
+ ApplicationContainer apps = onoff.Install (c.Get (0));
+ apps.Start (Seconds (1.0));
+ apps.Stop (Seconds (10.0));
+
+ NS_LOG_INFO ("Create Sink.");
+ PacketSinkHelper sink = PacketSinkHelper ("ns3::Ipv4RawSocketFactory", dst);
+ apps = sink.Install (c.Get (3));
+ apps.Start (Seconds (0.0));
+ apps.Stop (Seconds (11.0));
+
+ NS_LOG_INFO ("Configure Tracing.");
+ // first, pcap tracing.
+ csma.EnablePcapAll ("csma-raw-ip-socket");
+ // then, print what the packet sink receives.
+ Config::ConnectWithoutContext ("/NodeList/3/ApplicationList/0/$ns3::PacketSink/Rx",
+ MakeCallback (&SinkRx));
+
+ Packet::EnablePrinting ();
+
+
+ NS_LOG_INFO ("Run Simulation.");
+ Simulator::Run ();
+ Simulator::Destroy ();
+ NS_LOG_INFO ("Done.");
+}
diff --git a/examples/csma-star.cc b/examples/csma-star.cc
index 8a1d854d3..210b478da 100644
--- a/examples/csma-star.cc
+++ b/examples/csma-star.cc
@@ -115,7 +115,8 @@ main (int argc, char *argv[])
// Assign IPv4 interfaces and IP addresses to the devices we previously
// created. Keep track of the resulting addresses, one for the addresses
// of the hub node, and one for addresses on the spoke nodes. Despite the
- // name of the class, what is visible to clients is really the address.
+ // name of the class (Ipv4InterfaceContainer), what is visible to clients
+ // is really the address not the interface.
//
Ipv4InterfaceContainer hubAddresses;
Ipv4InterfaceContainer spokeAddresses;
@@ -128,6 +129,20 @@ main (int argc, char *argv[])
address.SetBase (subnet.str ().c_str (), "255.255.255.0");
hubAddresses.Add (address.Assign (hubDevices.Get (i)));
spokeAddresses.Add (address.Assign (spokeDevices.Get (i)));
+ //
+ // We assigned addresses to the logical hub and the first "drop" of the
+ // CSMA network that acts as the spoke, but we also have a number of fill
+ // devices (nFill) also hanging off the CSMA network. We have got to
+ // assign addresses to them as well. We put all of the fill devices into
+ // a single device container, so the first nFill devices are associated
+ // with the channel connected to spokeDevices.Get (0), the second nFill
+ // devices afe associated with the channel connected to spokeDevices.Get (1)
+ // etc.
+ //
+ for (uint32_t j = 0; j < nFill; ++j)
+ {
+ address.Assign (fillDevices.Get (i * nFill + j));
+ }
}
NS_LOG_INFO ("Create applications.");
@@ -190,7 +205,7 @@ main (int argc, char *argv[])
//
// Do pcap tracing on all devices on all nodes.
//
- PointToPointHelper::EnablePcapAll ("csma-star");
+ CsmaHelper::EnablePcapAll ("csma-star");
NS_LOG_INFO ("Run Simulation.");
Simulator::Run ();
diff --git a/examples/emu-udp-echo.cc b/examples/emu-udp-echo.cc
new file mode 100644
index 000000000..7a003ab8b
--- /dev/null
+++ b/examples/emu-udp-echo.cc
@@ -0,0 +1,156 @@
+/* -*- 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
+//
+// Normally, the use case for emulated net devices is in collections of
+// small simulations that connect to the outside world through specific
+// interfaces. For example, one could construct a number of virtual
+// machines and connect them via a host-only network. To use the emulated
+// net device, you would need to set all of the host-only interfaces in
+// promiscuous mode and provide an appropriate device name (search for "eth1"
+// below). One could also use the emulated net device in a testbed situation
+// where the host on which the simulation is running has a specific interface
+// of interested. You would also need to set this specific interface into
+// promiscuous mode and provide an appropriate device name.
+//
+// This philosophy carries over to this simple example.
+//
+// We don't assume any special configuration and all of the ns-3 emulated net
+// devices will actually talk to the same underlying OS device. We rely on
+// the fact that the OS will deliver copies of our packets to the other ns-3
+// net devices since we operate in promiscuous mode.
+//
+// Packets will be sent out over the device, but we use MAC spoofing. The
+// MAC addresses will be generated using the Organizationally Unique Identifier
+// (OUI) 00:00:00 as a base. This vendor code is not assigned to any
+// organization and so should not conflict with any real hardware. We'll use
+// the first n of these addresses, where n is the number of nodes, in this
+// simualtion. It is up to you to determine that using these MAC addresses is
+// okay on your network and won't conflict with anything else (including another
+// simulation using emu devices) on your network. Once you have made this
+// determination, you need to put the interface you chose into promiscuous mode.
+// We don't do it for you since you need to think about it first.
+//
+// This simulation uses the real-time simulator and so will consume ten seconds
+// of real time.
+//
+// By default, we create the following topology
+//
+// n0 n1 n2 n3
+// | | | |
+// -----------------
+// "eth1"
+//
+// - UDP flows from n0 to n1 and back
+// - DropTail queues
+// - Tracing of queues and packet receptions to file "udp-echo.tr"
+// - pcap tracing on all devices
+//
+
+#include
+#include "ns3/core-module.h"
+#include "ns3/simulator-module.h"
+#include "ns3/helper-module.h"
+
+using namespace ns3;
+
+NS_LOG_COMPONENT_DEFINE ("EmulatedUdpEchoExample");
+
+int
+main (int argc, char *argv[])
+{
+ std::string deviceName ("eth1");
+ uint32_t nNodes = 4;
+
+ //
+ // Allow the user to override any of the defaults at run-time, via command-line
+ // arguments
+ //
+ CommandLine cmd;
+ cmd.AddValue("deviceName", "device name", deviceName);
+ cmd.AddValue("nNodes", "number of nodes to create (>= 2)", nNodes);
+ cmd.Parse (argc, argv);
+
+ GlobalValue::Bind ("SimulatorImplementationType",
+ StringValue ("ns3::RealtimeSimulatorImpl"));
+
+ //
+ // need at least two nodes
+ //
+ nNodes = nNodes < 2 ? 2 : nNodes;
+
+ //
+ // Explicitly create the nodes required by the topology (shown above).
+ //
+ NS_LOG_INFO ("Create nodes.");
+ NodeContainer n;
+ n.Create (nNodes);
+
+ InternetStackHelper internet;
+ internet.Install (n);
+
+ //
+ // Explicitly create the channels required by the topology (shown above).
+ //
+ NS_LOG_INFO ("Create channels.");
+ EmuHelper emu;
+ emu.SetAttribute ("DeviceName", StringValue (deviceName));
+ NetDeviceContainer d = emu.Install (n);
+
+ //
+ // We've got the "hardware" in place. Now we need to add IP addresses.
+ //
+ Ipv4AddressHelper ipv4;
+ NS_LOG_INFO ("Assign IP Addresses.");
+ ipv4.SetBase ("10.1.1.0", "255.255.255.0");
+ Ipv4InterfaceContainer i = ipv4.Assign (d);
+
+ //
+ // Create a UdpEchoServer application on node one.
+ //
+ NS_LOG_INFO ("Create Applications.");
+ UdpEchoServerHelper server (9);
+ ApplicationContainer apps = server.Install (n.Get(1));
+ apps.Start (Seconds (1.0));
+ apps.Stop (Seconds (10.0));
+
+ //
+ // Create a UdpEchoClient application to send UDP datagrams from node zero to node one.
+ //
+ uint32_t packetSize = 1024;
+ uint32_t maxPacketCount = 1;
+ Time interPacketInterval = Seconds (1.);
+ UdpEchoClientHelper client (i.GetAddress (1), 9);
+ client.SetAttribute ("MaxPackets", UintegerValue (maxPacketCount));
+ client.SetAttribute ("Interval", TimeValue (interPacketInterval));
+ client.SetAttribute ("PacketSize", UintegerValue (packetSize));
+ apps = client.Install (n.Get (0));
+ apps.Start (Seconds (2.0));
+ apps.Stop (Seconds (10.0));
+
+ std::ofstream ascii;
+ ascii.open ("emu-udp-echo.tr");
+ EmuHelper::EnablePcapAll ("emu-udp-echo");
+
+ //
+ // Now, do the actual simulation.
+ //
+ NS_LOG_INFO ("Run Simulation.");
+ Simulator::Run ();
+ Simulator::Destroy ();
+ NS_LOG_INFO ("Done.");
+}
diff --git a/examples/test-ipv6.cc b/examples/test-ipv6.cc
new file mode 100644
index 000000000..117ecf882
--- /dev/null
+++ b/examples/test-ipv6.cc
@@ -0,0 +1,70 @@
+/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
+/*
+ * Copyright (c) 2008 Louis Pasteur University / Telecom Bretagne
+ *
+ * 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: Angelos Chatzipapas /
+ *
+ */
+
+#include "ns3/log.h"
+//#include "ns3/ipv6.h"
+#include "ns3/ipv6-address.h"
+#include "ns3/node.h"
+#include "ns3/mac48-address.h"
+
+NS_LOG_COMPONENT_DEFINE ("TestIpv6");
+
+using namespace ns3;
+
+int
+main (int argc, char *argv[])
+{
+ LogComponentEnable ("TestIpv6", LOG_LEVEL_ALL);
+
+ NS_LOG_INFO ("Test Ipv6");
+
+ Mac48Address m_addresses[10];
+
+ m_addresses[0]=("00:00:00:00:00:01");
+ m_addresses[1]=("00:00:00:00:00:02");
+ m_addresses[2]=("00:00:00:00:00:03");
+ m_addresses[3]=("00:00:00:00:00:04");
+ m_addresses[4]=("00:00:00:00:00:05");
+ m_addresses[5]=("00:00:00:00:00:06");
+ m_addresses[6]=("00:00:00:00:00:07");
+ m_addresses[7]=("00:00:00:00:00:08");
+ m_addresses[8]=("00:00:00:00:00:09");
+ m_addresses[9]=("00:00:00:00:00:10");
+
+ Ipv6Address prefix1 ("2001:1::");
+ NS_LOG_INFO ("prefix = " << prefix1);
+ for (uint32_t i = 0; i < 10 ; ++i)
+ {
+ NS_LOG_INFO ("address = " < /dev/null 2>&1")
+
+ if pyscript is None:
+ Params.g_options.cwd_launch = traceDirName
+ wutils.run_program(testName, command_template=wutils.get_command_template(*arguments))
+ else:
+ argv = [self.env['PYTHON'], os.path.join('..', '..', '..', *os.path.split(pyscript))] + arguments
+ before = os.getcwd()
+ os.chdir(traceDirName)
+ try:
+ wutils.run_argv(argv)
+ finally:
+ os.chdir(before)
+
+ if verbose:
+ #diffCmd = "diff traces " + refTestDirName + " | head"
+ diffCmd = subprocess.Popen([self.env['DIFF'], traceDirName, refTestDirName],
+ 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'], traceDirName, refTestDirName], stdout=dev_null()).wait()
+ if rc:
+ print "----------"
+ print "Traces differ in test: test-" + testName
+ print "Reference traces in directory: regression/" + refTestDirName
+ print "Traces in directory: traces"
+ print "Rerun regression test as: " + \
+ "\"./waf --regression --regression-tests=test-" + testName + "\""
+ print "Then do \"diff -u regression/" + refTestDirName + " regression/" + traceDirName +\
+ "\" for details"
+ print "----------"
+ return rc
+
+def _find_tests(testdir):
+ """Return a list of test modules in the test directory
+
+ Arguments:
+ testdir -- the directory to look in for tests
+ """
+ names = os.listdir(testdir)
+ tests = []
+ for name in names:
+ if name[:5] == "test-" and name[-3:] == ".py":
+ testname = name[:-3]
+ tests.append(testname)
+ tests.sort()
+ return tests
+
+def run_regression(reference_traces):
+ """Execute regression tests. Called with cwd set to the 'regression' subdir of ns-3.
+
+ @param reference_traces: reference traces directory, or None for default.
+
+ """
+
+ testdir = "tests"
+ if not os.path.exists(testdir):
+ print "Tests directory does not exist"
+ sys.exit(3)
+
+ dir_name = (wutils.APPNAME + '-' + wutils.VERSION + REGRESSION_SUFFIX)
+ if reference_traces is None:
+ reference_traces = dir_name
+ no_net = False
+ else:
+ no_net = True
+
+ sys.path.append(testdir)
+ sys.modules['tracediff'] = Regression(testdir, reference_traces)
+
+ if Params.g_options.regression_tests:
+ tests = Params.g_options.regression_tests.split(',')
+ else:
+ tests = _find_tests(testdir)
+
+ print "========== Running Regression Tests =========="
+ env = Params.g_build.env_of_name('default')
+ if not no_net:
+ if env['MERCURIAL']:
+ print "Synchronizing reference traces using Mercurial."
+ if not os.path.exists(reference_traces):
+ print "Cloning " + REGRESSION_TRACES_REPO + dir_name + " from repo."
+ argv = ["hg", "clone", REGRESSION_TRACES_REPO + dir_name, reference_traces]
+ rv = subprocess.Popen(argv).wait()
+ else:
+ _dir = os.getcwd()
+ os.chdir(reference_traces)
+ try:
+ print "Pulling " + REGRESSION_TRACES_REPO + dir_name + " from repo."
+ result = subprocess.Popen(["hg", "-q", "pull", REGRESSION_TRACES_REPO + dir_name]).wait()
+ if not result:
+ result = subprocess.Popen(["hg", "-q", "update"]).wait()
+ finally:
+ os.chdir("..")
+ if result:
+ Params.fatal("Synchronizing reference traces using Mercurial failed.")
+ else:
+ if not os.path.exists(reference_traces):
+ traceball = dir_name + wutils.TRACEBALL_SUFFIX
+ print "Retrieving " + traceball + " from web."
+ urllib.urlretrieve(REGRESSION_TRACES_URL + traceball, traceball)
+ os.system("tar -xjf %s -C .." % (traceball))
+ print "Done."
+
+ if not os.path.exists(reference_traces):
+ print "Reference traces directory (%s) does not exist" % reference_traces
+ return 3
+
+ bad = []
+
+ for test in tests:
+ try:
+ result = _run_regression_test(test)
+ if result == 0:
+ if Params.g_options.regression_generate:
+ print "GENERATE " + test
+ else:
+ print "PASS " + test
+ else:
+ bad.append(test)
+ print "FAIL " + test
+ except NotImplementedError:
+ print "SKIP " + test
+
+ return len(bad) > 0
+
+
+def _run_regression_test(test):
+ """Run a single test.
+
+ Arguments:
+ test -- the name of the test
+ """
+
+ if os.path.exists("traces"):
+ files = os.listdir("traces")
+ for file in files:
+ if file == '.' or file == '..':
+ continue
+ shutil.rmtree(os.path.join("traces", file), ignore_errors=True)
+ else:
+ os.mkdir("traces")
+
+ mod = __import__(test, globals(), locals(), [])
+ return mod.run(verbose=(Params.g_options.verbose > 0),
+ generate=Params.g_options.regression_generate)
+
diff --git a/regression/tests/test-csma-bridge.py b/regression/tests/test-csma-bridge.py
index 996bc1da9..67a1b4475 100644
--- a/regression/tests/test-csma-bridge.py
+++ b/regression/tests/test-csma-bridge.py
@@ -6,10 +6,10 @@ import os
import sys
import tracediff
-def run(verbose, generate, refDirName):
+def run(verbose, generate):
"""Execute a test."""
if tracediff.env['ENABLE_PYTHON_BINDINGS']:
- return tracediff.run_test(verbose, generate, refDirName,
+ return tracediff.run_test(verbose, generate,
"csma-bridge", pyscript=os.path.join('examples', 'csma-bridge.py'))
else:
print >> sys.stderr, "Skipping csma-bridge: Python bindings not available."
diff --git a/regression/tests/test-csma-broadcast.py b/regression/tests/test-csma-broadcast.py
index c3792678c..b34d136dc 100644
--- a/regression/tests/test-csma-broadcast.py
+++ b/regression/tests/test-csma-broadcast.py
@@ -6,7 +6,7 @@ import os
import shutil
import tracediff
-def run(verbose, generate, refDirName):
+def run(verbose, generate):
"""Execute a test."""
- return tracediff.run_test(verbose, generate, refDirName, "csma-broadcast")
+ return tracediff.run_test(verbose, generate, "csma-broadcast")
diff --git a/regression/tests/test-csma-multicast.py b/regression/tests/test-csma-multicast.py
index 77cb59a20..c128f273b 100644
--- a/regression/tests/test-csma-multicast.py
+++ b/regression/tests/test-csma-multicast.py
@@ -6,7 +6,7 @@ import os
import shutil
import tracediff
-def run(verbose, generate, refDirName):
+def run(verbose, generate):
"""Execute a test."""
- return tracediff.run_test(verbose, generate, refDirName, "csma-multicast")
+ return tracediff.run_test(verbose, generate, "csma-multicast")
diff --git a/regression/tests/test-csma-one-subnet.py b/regression/tests/test-csma-one-subnet.py
index 1ef4e27dc..b5d4645fc 100644
--- a/regression/tests/test-csma-one-subnet.py
+++ b/regression/tests/test-csma-one-subnet.py
@@ -6,7 +6,7 @@ import os
import shutil
import tracediff
-def run(verbose, generate, refDirName):
+def run(verbose, generate):
"""Execute a test."""
- return tracediff.run_test(verbose, generate, refDirName, "csma-one-subnet")
+ return tracediff.run_test(verbose, generate, "csma-one-subnet")
diff --git a/regression/tests/test-csma-packet-socket.py b/regression/tests/test-csma-packet-socket.py
index 2e17f3a74..ca71d7b9d 100644
--- a/regression/tests/test-csma-packet-socket.py
+++ b/regression/tests/test-csma-packet-socket.py
@@ -6,8 +6,8 @@ import os
import shutil
import tracediff
-def run(verbose, generate, refDirName):
+def run(verbose, generate):
"""Execute a test."""
- return tracediff.run_test(verbose, generate, refDirName,
+ return tracediff.run_test(verbose, generate,
"csma-packet-socket")
diff --git a/regression/tests/test-csma-ping.py b/regression/tests/test-csma-ping.py
new file mode 100644
index 000000000..4cae6945f
--- /dev/null
+++ b/regression/tests/test-csma-ping.py
@@ -0,0 +1,12 @@
+#! /usr/bin/env python
+
+"""Generic trace-comparison-type regression test."""
+
+import os
+import shutil
+import tracediff
+
+def run(verbose, generate):
+ """Execute a test."""
+
+ return tracediff.run_test(verbose, generate, "csma-ping")
diff --git a/regression/tests/test-csma-raw-ip-socket.py b/regression/tests/test-csma-raw-ip-socket.py
new file mode 100644
index 000000000..3c45b023d
--- /dev/null
+++ b/regression/tests/test-csma-raw-ip-socket.py
@@ -0,0 +1,12 @@
+#! /usr/bin/env python
+
+"""Generic trace-comparison-type regression test."""
+
+import os
+import shutil
+import tracediff
+
+def run(verbose, generate):
+ """Execute a test."""
+
+ return tracediff.run_test(verbose, generate, "csma-raw-ip-socket")
diff --git a/regression/tests/test-csma-star.py b/regression/tests/test-csma-star.py
new file mode 100644
index 000000000..4e39f0443
--- /dev/null
+++ b/regression/tests/test-csma-star.py
@@ -0,0 +1,12 @@
+#! /usr/bin/env python
+
+"""Generic trace-comparison-type regression test."""
+
+import os
+import shutil
+import tracediff
+
+def run(verbose, generate):
+ """Execute a test."""
+
+ return tracediff.run_test(verbose, generate, "csma-star")
diff --git a/regression/tests/test-realtime-udp-echo.py b/regression/tests/test-realtime-udp-echo.py
index 76ac10b52..b1344cdad 100644
--- a/regression/tests/test-realtime-udp-echo.py
+++ b/regression/tests/test-realtime-udp-echo.py
@@ -6,7 +6,7 @@ import os
import shutil
import tracediff
-def run(verbose, generate, refDirName):
+def run(verbose, generate):
"""Execute a test."""
- return tracediff.run_test(verbose, generate, refDirName, "realtime-udp-echo")
+ return tracediff.run_test(verbose, generate, "realtime-udp-echo")
diff --git a/regression/tests/test-simple-error-model.py b/regression/tests/test-simple-error-model.py
index e0f24b317..6a9dece25 100644
--- a/regression/tests/test-simple-error-model.py
+++ b/regression/tests/test-simple-error-model.py
@@ -6,8 +6,8 @@ import os
import shutil
import tracediff
-def run(verbose, generate, refDirName):
+def run(verbose, generate):
"""Execute a test."""
- return tracediff.run_test(verbose, generate, refDirName,
+ return tracediff.run_test(verbose, generate,
"simple-error-model")
diff --git a/regression/tests/test-simple-global-routing.py b/regression/tests/test-simple-global-routing.py
index de9fb49d1..271fb8f85 100644
--- a/regression/tests/test-simple-global-routing.py
+++ b/regression/tests/test-simple-global-routing.py
@@ -6,8 +6,8 @@ import os
import shutil
import tracediff
-def run(verbose, generate, refDirName):
+def run(verbose, generate):
"""Execute a test."""
- return tracediff.run_test(verbose, generate, refDirName,
+ return tracediff.run_test(verbose, generate,
"simple-global-routing")
diff --git a/regression/tests/test-simple-point-to-point-olsr.py b/regression/tests/test-simple-point-to-point-olsr.py
index 10beaa255..b581b876f 100644
--- a/regression/tests/test-simple-point-to-point-olsr.py
+++ b/regression/tests/test-simple-point-to-point-olsr.py
@@ -6,8 +6,8 @@ import os
import shutil
import tracediff
-def run(verbose, generate, refDirName):
+def run(verbose, generate):
"""Execute a test."""
- return tracediff.run_test(verbose, generate, refDirName,
+ return tracediff.run_test(verbose, generate,
"simple-point-to-point-olsr")
diff --git a/regression/tests/test-tcp-large-transfer.py b/regression/tests/test-tcp-large-transfer.py
index e03a85ece..3078fa69d 100644
--- a/regression/tests/test-tcp-large-transfer.py
+++ b/regression/tests/test-tcp-large-transfer.py
@@ -6,8 +6,8 @@ import os
import shutil
import tracediff
-def run(verbose, generate, refDirName):
+def run(verbose, generate):
"""Execute a test."""
- return tracediff.run_test(verbose, generate, refDirName,
+ return tracediff.run_test(verbose, generate,
"tcp-large-transfer")
diff --git a/regression/tests/test-tcp-nsc-lfn.py b/regression/tests/test-tcp-nsc-lfn.py
index 84042603f..bff77dfd0 100644
--- a/regression/tests/test-tcp-nsc-lfn.py
+++ b/regression/tests/test-tcp-nsc-lfn.py
@@ -9,7 +9,7 @@ import tracediff
import platform
-def run(verbose, generate, refDirName):
+def run(verbose, generate):
"""Run a Network Simulation Cradle test involving two TCP streams."""
if not tracediff.env['ENABLE_NSC']:
@@ -29,5 +29,5 @@ def run(verbose, generate, refDirName):
# string might not be the best idea?
raise "Unknown architecture, not 64 or 32 bit?"
- return tracediff.run_test(verbose, generate, refDirName,
+ return tracediff.run_test(verbose, generate,
testName, arguments=arguments, refTestName=traceDirName)
diff --git a/regression/tests/test-udp-echo.py b/regression/tests/test-udp-echo.py
index 46346f5a4..6fe71055a 100644
--- a/regression/tests/test-udp-echo.py
+++ b/regression/tests/test-udp-echo.py
@@ -6,7 +6,7 @@ import os
import shutil
import tracediff
-def run(verbose, generate, refDirName):
+def run(verbose, generate):
"""Execute a test."""
#print tracediff.env
- return tracediff.run_test(verbose, generate, refDirName, "udp-echo")
+ return tracediff.run_test(verbose, generate, "udp-echo")
diff --git a/regression/tests/test-wifi-wired-bridging.py b/regression/tests/test-wifi-wired-bridging.py
index cda3a3dfd..9ff8ae0e5 100644
--- a/regression/tests/test-wifi-wired-bridging.py
+++ b/regression/tests/test-wifi-wired-bridging.py
@@ -6,7 +6,7 @@ import os
import shutil
import tracediff
-def run(verbose, generate, refDirName):
+def run(verbose, generate):
"""Execute a test."""
- return tracediff.run_test(verbose, generate, refDirName, "wifi-wired-bridging", ["--SendIp=0"])
+ return tracediff.run_test(verbose, generate, "wifi-wired-bridging", ["--SendIp=0"])
diff --git a/samples/main-test-sync.cc b/samples/main-test-sync.cc
index 0db9f7151..b1e8fcc07 100644
--- a/samples/main-test-sync.cc
+++ b/samples/main-test-sync.cc
@@ -61,7 +61,7 @@ FakeNetDevice::Doit3 (void)
{
NS_LOG_FUNCTION_NOARGS ();
sleep (1);
- for (uint32_t i = 0.001; i < 10000; ++i)
+ for (uint32_t i = 0; i < 10000; ++i)
{
//
// Exercise the realtime relative now path
@@ -76,7 +76,7 @@ FakeNetDevice::Doit4 (void)
{
NS_LOG_FUNCTION_NOARGS ();
sleep (1);
- for (uint32_t i = 0.001; i < 10000; ++i)
+ for (uint32_t i = 0; i < 10000; ++i)
{
//
// Exercise the realtime relative schedule path
@@ -100,7 +100,7 @@ test (void)
DynamicCast (Simulator::GetImplementation ())->ScheduleRealtimeNow(MakeEvent (&first_function));
//
- // drive the progression of m_currentTs at a ten millisecond rate
+ // drive the progression of m_currentTs at a ten millisecond rate from the main thread
//
for (double d = 0.; d < 14.999; d += 0.01)
{
diff --git a/src/applications/v4ping/v4ping.cc b/src/applications/v4ping/v4ping.cc
new file mode 100644
index 000000000..e70917e60
--- /dev/null
+++ b/src/applications/v4ping/v4ping.cc
@@ -0,0 +1,155 @@
+#include "v4ping.h"
+#include "ns3/icmpv4.h"
+#include "ns3/assert.h"
+#include "ns3/log.h"
+#include "ns3/ipv4-address.h"
+#include "ns3/socket.h"
+#include "ns3/uinteger.h"
+#include "ns3/inet-socket-address.h"
+#include "ns3/packet.h"
+#include "ns3/trace-source-accessor.h"
+#include "ns3/simulator.h"
+
+namespace ns3 {
+
+NS_LOG_COMPONENT_DEFINE ("V4Ping");
+NS_OBJECT_ENSURE_REGISTERED (V4Ping);
+
+TypeId
+V4Ping::GetTypeId (void)
+{
+ static TypeId tid = TypeId ("ns3::V4Ping")
+ .SetParent ()
+ .AddConstructor ()
+ .AddAttribute ("Remote",
+ "The address of the machine we want to ping.",
+ Ipv4AddressValue (),
+ MakeIpv4AddressAccessor (&V4Ping::m_remote),
+ MakeIpv4AddressChecker ())
+ .AddTraceSource ("Rtt",
+ "The rtt calculated by the ping.",
+ MakeTraceSourceAccessor (&V4Ping::m_traceRtt));
+ ;
+ return tid;
+}
+
+V4Ping::V4Ping ()
+ : m_socket (0),
+ m_seq (0)
+{}
+V4Ping::~V4Ping ()
+{}
+
+void
+V4Ping::DoDispose (void)
+{
+ NS_LOG_FUNCTION (this);
+ m_socket = 0;
+ Application::DoDispose ();
+}
+
+uint32_t
+V4Ping::GetApplicationId (void) const
+{
+ Ptr node = GetNode ();
+ for (uint32_t i = 0; i < node->GetNApplications (); ++i)
+ {
+ if (node->GetApplication (i) == this)
+ {
+ return i;
+ }
+ }
+ NS_ASSERT_MSG (false, "forgot to add application to node");
+ return 0; // quiet compiler
+}
+
+void
+V4Ping::Receive (Ptr socket)
+{
+ NS_LOG_FUNCTION (this << socket);
+ while (m_socket->GetRxAvailable () > 0)
+ {
+ Address from;
+ Ptr p = m_socket->RecvFrom (0xffffffff, 0, from);
+ NS_LOG_DEBUG ("recv " << p->GetSize () << " bytes");
+ NS_ASSERT (InetSocketAddress::IsMatchingType (from));
+ InetSocketAddress realFrom = InetSocketAddress::ConvertFrom (from);
+ NS_ASSERT (realFrom.GetPort () == 1); // protocol should be icmp.
+ Ipv4Header ipv4;
+ p->RemoveHeader (ipv4);
+ NS_ASSERT (ipv4.GetProtocol () == 1); // protocol should be icmp.
+ Icmpv4Header icmp;
+ p->RemoveHeader (icmp);
+ if (icmp.GetType () == Icmpv4Header::ECHO_REPLY)
+ {
+ Icmpv4Echo echo;
+ p->RemoveHeader (echo);
+ if (echo.GetSequenceNumber () == (m_seq - 1) &&
+ echo.GetIdentifier () == 0)
+ {
+ Ptr data = echo.GetData ();
+ if (data->GetSize () == 16)
+ {
+ uint32_t *buf = (uint32_t *)data->PeekData ();
+ if (buf[0] == GetNode ()->GetId () &&
+ buf[1] == GetApplicationId ())
+ {
+ int64_t ts = buf[3];
+ ts <<= 32;
+ ts |= buf[2];
+ Time sendTime = TimeStep (ts);
+ NS_ASSERT (Simulator::Now () > sendTime);
+ Time delta = Simulator::Now () - sendTime;
+ m_traceRtt (delta);
+ }
+ }
+ }
+ }
+ }
+}
+
+void
+V4Ping::StartApplication (void)
+{
+ NS_LOG_FUNCTION (this);
+ m_socket = Socket::CreateSocket (GetNode (), TypeId::LookupByName ("ns3::Ipv4RawSocketFactory"));
+ NS_ASSERT (m_socket != 0);
+ m_socket->SetAttribute ("Protocol", UintegerValue (1)); // icmp
+ m_socket->SetRecvCallback (MakeCallback (&V4Ping::Receive, this));
+ InetSocketAddress src = InetSocketAddress (Ipv4Address::GetAny (), 0);
+ int status;
+ status = m_socket->Bind (src);
+ NS_ASSERT (status != -1);
+ InetSocketAddress dst = InetSocketAddress (m_remote, 0);
+ status = m_socket->Connect (dst);
+ NS_ASSERT (status != -1);
+ Ptr p = Create ();
+ Icmpv4Echo echo;
+ echo.SetSequenceNumber (m_seq);
+ m_seq++;
+ echo.SetIdentifier (0);
+ uint32_t data[4];
+ data[0] = GetNode ()->GetId ();
+ data[1] = GetApplicationId ();
+ int64_t now = Simulator::Now ().GetTimeStep ();
+ data[2] = now & 0xffffffff;
+ now >>= 32;
+ data[3] = now & 0xffffffff;
+ Ptr dataPacket = Create ((uint8_t *) &data, 16);
+ echo.SetData (dataPacket);
+ p->AddHeader (echo);
+ Icmpv4Header header;
+ header.SetType (Icmpv4Header::ECHO);
+ header.SetCode (0);
+ p->AddHeader (header);
+ m_socket->Send (p, 0);
+
+}
+void
+V4Ping::StopApplication (void)
+{
+ NS_LOG_FUNCTION (this);
+}
+
+
+} // namespace ns3
diff --git a/src/applications/v4ping/v4ping.h b/src/applications/v4ping/v4ping.h
new file mode 100644
index 000000000..800ab1fbb
--- /dev/null
+++ b/src/applications/v4ping/v4ping.h
@@ -0,0 +1,36 @@
+#ifndef V4PING_H
+#define V4PING_H
+
+#include "ns3/application.h"
+#include "ns3/traced-callback.h"
+#include "ns3/nstime.h"
+
+namespace ns3 {
+
+class Socket;
+
+class V4Ping : public Application
+{
+public:
+ static TypeId GetTypeId (void);
+
+ V4Ping ();
+ virtual ~V4Ping ();
+
+private:
+ // inherited from Application base class.
+ virtual void StartApplication (void);
+ virtual void StopApplication (void);
+ virtual void DoDispose (void);
+ uint32_t GetApplicationId (void) const;
+ void Receive (Ptr socket);
+
+ Ipv4Address m_remote;
+ Ptr m_socket;
+ uint16_t m_seq;
+ TracedCallback m_traceRtt;
+};
+
+} // namespace ns3
+
+#endif /* V4PING_H */
diff --git a/src/applications/v4ping/wscript b/src/applications/v4ping/wscript
new file mode 100644
index 000000000..a4c56c3f3
--- /dev/null
+++ b/src/applications/v4ping/wscript
@@ -0,0 +1,13 @@
+## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
+
+def build(bld):
+ module = bld.create_ns3_module('v4ping', ['node'])
+ module.source = [
+ 'v4ping.cc',
+ ]
+ headers = bld.create_obj('ns3header')
+ headers.module = 'v4ping'
+ headers.source = [
+ 'v4ping.h',
+ ]
+
diff --git a/src/contrib/stats/sqlite-data-output.cc b/src/contrib/stats/sqlite-data-output.cc
index 68362bf33..79058e0c6 100644
--- a/src/contrib/stats/sqlite-data-output.cc
+++ b/src/contrib/stats/sqlite-data-output.cc
@@ -33,7 +33,6 @@ using namespace ns3;
NS_LOG_COMPONENT_DEFINE("SqliteDataOutput");
-
//--------------------------------------------------------------
//----------------------------------------------
SqliteDataOutput::SqliteDataOutput() :
@@ -232,7 +231,7 @@ SqliteDataOutput::SqliteOutputCallback::OutputSingleton(std::string key,
m_runLabel << "', '" <<
key << "', '" <<
variable << "', " <<
- val << ")";
+ val.GetTimeStep() << ")";
m_owner->Exec(sstr.str());
// end SqliteDataOutput::SqliteOutputCallback::OutputSingleton
}
diff --git a/src/core/object.cc b/src/core/object.cc
index 9640d158b..e2a56d22a 100644
--- a/src/core/object.cc
+++ b/src/core/object.cc
@@ -111,10 +111,11 @@ Object::DoGetObject (TypeId tid) const
{
NS_ASSERT (CheckLoose ());
const Object *currentObject = this;
+ TypeId objectTid = Object::GetTypeId ();
do {
NS_ASSERT (currentObject != 0);
TypeId cur = currentObject->GetInstanceTypeId ();
- while (cur != tid && cur != Object::GetTypeId ())
+ while (cur != tid && cur != objectTid)
{
cur = cur.GetParent ();
}
diff --git a/src/core/type-id.cc b/src/core/type-id.cc
index b477b8a5b..90d400c05 100644
--- a/src/core/type-id.cc
+++ b/src/core/type-id.cc
@@ -365,10 +365,6 @@ namespace ns3 {
* The TypeId class
*********************************************************************/
-TypeId::TypeId ()
- : m_tid (0)
-{}
-
TypeId::TypeId (const char *name)
{
uint16_t uid = Singleton::Get ()->AllocateUid (name);
@@ -380,8 +376,6 @@ TypeId::TypeId (const char *name)
TypeId::TypeId (uint16_t tid)
: m_tid (tid)
{}
-TypeId::~TypeId ()
-{}
TypeId
TypeId::LookupByName (std::string name)
{
@@ -692,16 +686,6 @@ std::istream & operator >> (std::istream &is, TypeId &tid)
ATTRIBUTE_HELPER_CPP (TypeId);
-bool operator == (TypeId a, TypeId b)
-{
- return a.m_tid == b.m_tid;
-}
-
-bool operator != (TypeId a, TypeId b)
-{
- return a.m_tid != b.m_tid;
-}
-
bool operator < (TypeId a, TypeId b)
{
return a.m_tid < b.m_tid;
diff --git a/src/core/type-id.h b/src/core/type-id.h
index 423983be4..f6d9790bc 100644
--- a/src/core/type-id.h
+++ b/src/core/type-id.h
@@ -351,8 +351,10 @@ public:
void SetUid (uint16_t tid);
// construct an invalid TypeId.
- TypeId ();
- ~TypeId ();
+ inline TypeId ();
+ inline TypeId (const TypeId &o);
+ inline TypeId &operator = (const TypeId &o);
+ inline ~TypeId ();
private:
friend class AttributeList;
@@ -377,8 +379,8 @@ private:
std::ostream & operator << (std::ostream &os, TypeId tid);
std::istream & operator >> (std::istream &is, TypeId &tid);
-bool operator == (TypeId a, TypeId b);
-bool operator != (TypeId a, TypeId b);
+inline bool operator == (TypeId a, TypeId b);
+inline bool operator != (TypeId a, TypeId b);
bool operator < (TypeId a, TypeId b);
/**
@@ -393,6 +395,28 @@ ATTRIBUTE_HELPER_HEADER (TypeId);
namespace ns3 {
+TypeId::TypeId ()
+ : m_tid (0) {}
+TypeId::TypeId (const TypeId &o)
+ : m_tid (o.m_tid) {}
+TypeId &TypeId::operator = (const TypeId &o)
+{
+ m_tid = o.m_tid;
+ return *this;
+}
+TypeId::~TypeId ()
+{}
+inline bool operator == (TypeId a, TypeId b)
+{
+ return a.m_tid == b.m_tid;
+}
+
+inline bool operator != (TypeId a, TypeId b)
+{
+ return a.m_tid != b.m_tid;
+}
+
+
/*************************************************************************
* The TypeId implementation which depends on templates
*************************************************************************/
diff --git a/src/devices/bridge/bridge-net-device.cc b/src/devices/bridge/bridge-net-device.cc
index 1a7e561ff..e85ab5f78 100644
--- a/src/devices/bridge/bridge-net-device.cc
+++ b/src/devices/bridge/bridge-net-device.cc
@@ -290,16 +290,8 @@ BridgeNetDevice::IsMulticast (void) const
return true;
}
-
Address
-BridgeNetDevice::GetMulticast (void) const
-{
- return Mac48Address ("01:00:5e:00:00:00");
-}
-
-
-Address
-BridgeNetDevice::MakeMulticastAddress (Ipv4Address multicastGroup) const
+BridgeNetDevice::GetMulticast (Ipv4Address multicastGroup) const
{
NS_LOG_FUNCTION (this << multicastGroup);
Mac48Address multicast = Mac48Address::GetMulticast (multicastGroup);
@@ -388,6 +380,10 @@ BridgeNetDevice::DoDispose (void)
NetDevice::DoDispose ();
}
-
+Address BridgeNetDevice::GetMulticast (Ipv6Address addr) const
+{
+ NS_LOG_FUNCTION (this << addr);
+ return Mac48Address::GetMulticast (addr);
+}
} // namespace ns3
diff --git a/src/devices/bridge/bridge-net-device.h b/src/devices/bridge/bridge-net-device.h
index ed232cce9..d8532c4b9 100644
--- a/src/devices/bridge/bridge-net-device.h
+++ b/src/devices/bridge/bridge-net-device.h
@@ -96,8 +96,7 @@ public:
virtual bool IsBroadcast (void) const;
virtual Address GetBroadcast (void) const;
virtual bool IsMulticast (void) const;
- virtual Address GetMulticast (void) const;
- virtual Address MakeMulticastAddress (Ipv4Address multicastGroup) const;
+ virtual Address GetMulticast (Ipv4Address multicastGroup) const;
virtual bool IsPointToPoint (void) const;
virtual bool Send (Ptr packet, const Address& dest, uint16_t protocolNumber);
virtual bool SendFrom (Ptr packet, const Address& source, const Address& dest, uint16_t protocolNumber);
@@ -107,6 +106,7 @@ public:
virtual void SetReceiveCallback (NetDevice::ReceiveCallback cb);
virtual void SetPromiscReceiveCallback (NetDevice::PromiscReceiveCallback cb);
virtual bool SupportsSendFrom () const;
+ virtual Address GetMulticast (Ipv6Address addr) const;
protected:
virtual void DoDispose (void);
diff --git a/src/devices/csma/csma-net-device.cc b/src/devices/csma/csma-net-device.cc
index 391027d46..5e6766518 100644
--- a/src/devices/csma/csma-net-device.cc
+++ b/src/devices/csma/csma-net-device.cc
@@ -72,7 +72,7 @@ CsmaNetDevice::GetTypeId (void)
BooleanValue (true),
MakeBooleanAccessor (&CsmaNetDevice::m_receiveEnable),
MakeBooleanChecker ())
- .AddAttribute ("RxErrorModel",
+ .AddAttribute ("ReceiveErrorModel",
"The receiver error model used to simulate packet loss",
PointerValue (),
MakePointerAccessor (&CsmaNetDevice::m_receiveErrorModel),
@@ -600,6 +600,20 @@ CsmaNetDevice::Receive (Ptr packet, Ptr senderDevice)
NS_LOG_FUNCTION (packet << senderDevice);
NS_LOG_LOGIC ("UID is " << packet->GetUid ());
+ /* IPv6 support*/
+ uint8_t mac[6];
+ Mac48Address multicast6AllNodes("33:33:00:00:00:01");
+ Mac48Address multicast6AllRouters("33:33:00:00:00:02");
+ Mac48Address multicast6AllHosts("33:33:00:00:00:03");
+ Mac48Address multicast6Node; /* multicast address addressed to our MAC address */
+
+ /* generate IPv6 multicast ethernet destination that nodes will accept */
+ GetAddress().CopyTo(mac);
+ mac[0]=0x33;
+ mac[1]=0x33;
+ /* mac[2]=0xff; */
+ multicast6Node.CopyFrom(mac);
+
//
// We never forward up packets that we sent. Real devices don't do this since
// their receivers are disabled during send, so we don't. Drop the packet
@@ -672,7 +686,11 @@ CsmaNetDevice::Receive (Ptr packet, Ptr senderDevice)
packetType = PACKET_BROADCAST;
m_rxTrace (originalPacket);
}
- else if (header.GetDestination ().IsMulticast ())
+ else if (header.GetDestination ().IsMulticast () ||
+ header.GetDestination() == multicast6Node ||
+ header.GetDestination() == multicast6AllNodes ||
+ header.GetDestination() == multicast6AllRouters ||
+ header.GetDestination() == multicast6AllHosts)
{
packetType = PACKET_MULTICAST;
m_rxTrace (originalPacket);
@@ -796,14 +814,7 @@ CsmaNetDevice::IsMulticast (void) const
}
Address
-CsmaNetDevice::GetMulticast (void) const
-{
- NS_LOG_FUNCTION_NOARGS ();
- return Mac48Address::GetMulticastPrefix ();
-}
-
- Address
-CsmaNetDevice::MakeMulticastAddress (Ipv4Address multicastGroup) const
+CsmaNetDevice::GetMulticast (Ipv4Address multicastGroup) const
{
NS_LOG_FUNCTION (multicastGroup);
@@ -929,6 +940,14 @@ CsmaNetDevice::SetReceiveCallback (NetDevice::ReceiveCallback cb)
m_rxCallback = cb;
}
+Address CsmaNetDevice::GetMulticast (Ipv6Address addr) const
+{
+ Mac48Address ad = Mac48Address::GetMulticast (addr);
+
+ NS_LOG_LOGIC("MAC IPv6 multicast address is " << ad);
+ return ad;
+}
+
void
CsmaNetDevice::SetPromiscReceiveCallback (NetDevice::PromiscReceiveCallback cb)
{
diff --git a/src/devices/csma/csma-net-device.h b/src/devices/csma/csma-net-device.h
index f239c4a32..59b7d59a7 100644
--- a/src/devices/csma/csma-net-device.h
+++ b/src/devices/csma/csma-net-device.h
@@ -319,7 +319,6 @@ public:
virtual bool IsBroadcast (void) const;
virtual Address GetBroadcast (void) const;
virtual bool IsMulticast (void) const;
- virtual Address GetMulticast (void) const;
/**
* \brief Make and return a MAC multicast address using the provided
@@ -343,7 +342,7 @@ public:
* \see Mac48Address
* \see Address
*/
- virtual Address MakeMulticastAddress (Ipv4Address multicastGroup) const;
+ virtual Address GetMulticast (Ipv4Address multicastGroup) const;
/**
* Is this a point to point link?
@@ -393,6 +392,15 @@ public:
*/
virtual void SetReceiveCallback (NetDevice::ReceiveCallback cb);
+ /**
+ * \brief Get the MAC multicast address corresponding
+ * to the IPv6 address provided.
+ * \param addr IPv6 address
+ * \return the MAC multicast address
+ * \warning Calling this method is invalid if IsMulticast returns not true.
+ */
+ virtual Address GetMulticast (Ipv6Address addr) const;
+
virtual void SetPromiscReceiveCallback (PromiscReceiveCallback cb);
virtual bool SupportsSendFrom (void) const;
diff --git a/src/devices/emu/emu-encode-decode.cc b/src/devices/emu/emu-encode-decode.cc
new file mode 100644
index 000000000..49b044099
--- /dev/null
+++ b/src/devices/emu/emu-encode-decode.cc
@@ -0,0 +1,110 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/*
+ * Copyright (c) University of Washington
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation;
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include
+#include
+#include
+#include
+
+namespace ns3 {
+
+/**
+ * \brief Convert a byte buffer to a string containing a hex representation
+ * of the buffer. Make the string pretty by adding a colon (':') between
+ * the hex.
+ *
+ * \param buffer The input buffer to be converted.
+ * \param len The length of the input buffer.
+ * \returns A string containing a hex representation of the data in buffer.
+ */
+ std::string
+EmuBufferToString (uint8_t *buffer, uint32_t len)
+{
+ std::ostringstream oss;
+ //
+ // Tell the stream to make hex characters, zero-filled
+ //
+ oss.setf (std::ios::hex, std::ios::basefield);
+ oss.fill('0');
+
+ //
+ // Loop through the buffer, separating the two-digit-wide hex bytes
+ // with a colon.
+ //
+ for (uint8_t i = 0; i < len; i++)
+ {
+ oss << ":" << std::setw (2) << (uint32_t)buffer[i];
+ }
+ return oss.str ();
+}
+
+/**
+ * \brief Convert string encoded by the inverse function (EmuBufferToString)
+ * back into a byte buffer.
+ *
+ * \param s The input string.
+ * \param buffer The buffer to initialize with the converted bits.
+ * \param len The length of the data that is valid in the buffer.
+ * \returns True indicates a successful conversion.
+ */
+ bool
+EmuStringToBuffer (std::string s, uint8_t *buffer, uint32_t *len)
+{
+ //
+ // If the string was made by our inverse function, the string length must
+ // be a multiple of three characters in length. Use this fact to do a
+ // quick reasonableness test.
+ //
+ if ((s.length () % 3) != 0)
+ {
+ return false;
+ }
+
+ std::istringstream iss;
+ iss.str (s);
+
+ uint8_t n = 0;
+
+ while (iss.good ())
+ {
+ //
+ // The first character in the "triplet" we're working on is always the
+ // the ':' separator. Read that into a char and make sure we're skipping
+ // what we think we're skipping.
+ //
+ char c;
+ iss.read (&c, 1);
+ if (c != ':')
+ {
+ return false;
+ }
+
+ //
+ // And then read in the real bits and convert them.
+ //
+ uint32_t tmp;
+ iss >> std::hex >> tmp;
+ buffer[n] = tmp;
+ n++;
+ }
+
+ *len = n;
+ return true;
+}
+
+} // namespace ns3
diff --git a/src/devices/emu/emu-encode-decode.h b/src/devices/emu/emu-encode-decode.h
new file mode 100644
index 000000000..1d03f74e5
--- /dev/null
+++ b/src/devices/emu/emu-encode-decode.h
@@ -0,0 +1,33 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/*
+ * Copyright (c) 2008 University of Washington
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation;
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef EMU_ENCODE_DECODE_H
+#define EMU_ENCODE_DECODE_H
+
+#include
+
+namespace ns3 {
+
+ std::string EmuBufferToString (uint8_t *buffer, uint32_t len);
+ bool EmuStringToBuffer (std::string s, uint8_t *buffer, uint32_t *len);
+
+
+} // namespace ns3
+
+#endif // EMU_ENCODE_DECODE_H
+
diff --git a/src/devices/emu/emu-net-device.cc b/src/devices/emu/emu-net-device.cc
new file mode 100644
index 000000000..6e81f4bc1
--- /dev/null
+++ b/src/devices/emu/emu-net-device.cc
@@ -0,0 +1,923 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/*
+ * Copyright (c) 2008 University of Washington
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation;
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include "emu-net-device.h"
+#include "emu-encode-decode.h"
+
+#include "ns3/log.h"
+#include "ns3/queue.h"
+#include "ns3/simulator.h"
+#include "ns3/realtime-simulator-impl.h"
+#include "ns3/mac48-address.h"
+#include "ns3/ethernet-header.h"
+#include "ns3/ethernet-trailer.h"
+#include "ns3/llc-snap-header.h"
+#include "ns3/trace-source-accessor.h"
+#include "ns3/pointer.h"
+#include "ns3/channel.h"
+#include "ns3/system-thread.h"
+#include "ns3/string.h"
+#include "ns3/boolean.h"
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+NS_LOG_COMPONENT_DEFINE ("EmuNetDevice");
+
+namespace ns3 {
+
+NS_OBJECT_ENSURE_REGISTERED (EmuNetDevice);
+
+#define EMU_MAGIC 65867
+
+TypeId
+EmuNetDevice::GetTypeId (void)
+{
+ static TypeId tid = TypeId ("ns3::EmuNetDevice")
+ .SetParent ()
+ .AddConstructor ()
+ .AddAttribute ("Address",
+ "The ns-3 MAC address of this (virtual) device.",
+ Mac48AddressValue (Mac48Address ("ff:ff:ff:ff:ff:ff")),
+ MakeMac48AddressAccessor (&EmuNetDevice::m_address),
+ MakeMac48AddressChecker ())
+ .AddAttribute ("DeviceName",
+ "The name of the underlying real device (e.g. eth1).",
+ StringValue ("eth1"),
+ MakeStringAccessor (&EmuNetDevice::m_deviceName),
+ MakeStringChecker ())
+ .AddAttribute ("Start",
+ "The simulation time at which to spin up the device thread.",
+ TimeValue (Seconds (0.)),
+ MakeTimeAccessor (&EmuNetDevice::m_tStart),
+ MakeTimeChecker ())
+ .AddAttribute ("Stop",
+ "The simulation time at which to tear down the device thread.",
+ TimeValue (Seconds (0.)),
+ MakeTimeAccessor (&EmuNetDevice::m_tStop),
+ MakeTimeChecker ())
+ .AddAttribute ("TxQueue",
+ "A queue to use as the transmit queue in the device.",
+ PointerValue (),
+ MakePointerAccessor (&EmuNetDevice::m_queue),
+ MakePointerChecker ())
+ .AddTraceSource ("Rx",
+ "Trace source to fire on reception of a MAC packet.",
+ MakeTraceSourceAccessor (&EmuNetDevice::m_rxTrace))
+ .AddTraceSource ("Drop",
+ "Trace source to fire on when a MAC packet is dropped.",
+ MakeTraceSourceAccessor (&EmuNetDevice::m_dropTrace))
+ ;
+ return tid;
+}
+
+
+EmuNetDevice::EmuNetDevice ()
+:
+ m_startEvent (),
+ m_stopEvent (),
+ m_sock (-1),
+ m_readThread (0),
+ m_ifIndex (std::numeric_limits::max ()), // absurdly large value
+ m_sll_ifindex (-1),
+ m_name ("Emu NetDevice")
+{
+ NS_LOG_FUNCTION (this);
+ Start (m_tStart);
+}
+
+EmuNetDevice::~EmuNetDevice ()
+{
+}
+
+void
+EmuNetDevice::DoDispose()
+{
+ NS_LOG_FUNCTION_NOARGS ();
+ m_node = 0;
+ NetDevice::DoDispose ();
+}
+
+void
+EmuNetDevice::Start (Time tStart)
+{
+ NS_LOG_FUNCTION (tStart);
+
+ //
+ // Cancel any pending start event and schedule a new one at some relative time in the future.
+ //
+ Simulator::Cancel (m_startEvent);
+ m_startEvent = Simulator::Schedule (tStart, &EmuNetDevice::StartDevice, this);
+}
+
+ void
+EmuNetDevice::Stop (Time tStop)
+{
+ NS_LOG_FUNCTION (tStop);
+ //
+ // Cancel any pending stop event and schedule a new one at some relative time in the future.
+ //
+ Simulator::Cancel (m_stopEvent);
+ m_startEvent = Simulator::Schedule (tStop, &EmuNetDevice::StopDevice, this);
+}
+
+ void
+EmuNetDevice::StartDevice (void)
+{
+ NS_LOG_FUNCTION_NOARGS ();
+
+ //
+ // Spin up the emu net device and start receiving packets.
+ //
+ if (m_sock != -1)
+ {
+ NS_FATAL_ERROR ("EmuNetDevice::StartDevice(): Device is already started");
+ }
+
+ NS_LOG_LOGIC ("Creating socket");
+ //
+ // Call out to a separate process running as suid root in order to get a raw
+ // socket. We do this to avoid having the entire simulation running as root.
+ // If this method returns, we'll have a raw socket waiting for us in m_sock.
+ //
+ CreateSocket ();
+
+ //
+ // Figure out which interface index corresponds to the device name in the corresponding attribute.
+ //
+ struct ifreq ifr;
+ bzero (&ifr, sizeof(ifr));
+ strncpy ((char *)ifr.ifr_name, m_deviceName.c_str (), IFNAMSIZ);
+
+ NS_LOG_LOGIC ("Getting interface index");
+ int32_t rc = ioctl (m_sock, SIOCGIFINDEX, &ifr);
+ if (rc == -1)
+ {
+ NS_FATAL_ERROR ("EmuNetDevice::StartDevice(): Can't get interface index");
+ }
+
+ //
+ // Save the real interface index for later calls to sendto
+ //
+ m_sll_ifindex = ifr.ifr_ifindex;
+
+ //
+ // Bind the socket to the interface we just found.
+ //
+ struct sockaddr_ll ll;
+ bzero (&ll, sizeof(ll));
+
+ ll.sll_family = AF_PACKET;
+ ll.sll_ifindex = m_sll_ifindex;
+ ll.sll_protocol = htons(ETH_P_ALL);
+
+ NS_LOG_LOGIC ("Binding socket to interface");
+
+ rc = bind (m_sock, (struct sockaddr *)&ll, sizeof (ll));
+ if (rc == -1)
+ {
+ NS_FATAL_ERROR ("EmuNetDevice::StartDevice(): Can't bind to specified interface");
+ }
+
+ rc = ioctl(m_sock, SIOCGIFFLAGS, &ifr);
+ if (rc == -1)
+ {
+ NS_FATAL_ERROR ("EmuNetDevice::StartDevice(): Can't get interface flags");
+ }
+
+ //
+ // This device only works if the underlying interface is up in promiscuous
+ // mode. We could have turned it on in the socket creator, but the situation
+ // is that we expect these devices to be used in conjunction with virtual
+ // machines with connected host-only (simulated) networks, or in a testbed.
+ // There is a lot of setup and configuration happening outside of this one
+ // issue, and we expect that configuration to include choosing a valid
+ // interface (e.g, "ath1"), ensuring that the device supports promiscuous
+ // mode, and placing it in promiscuous mode. We just make sure of the
+ // end result.
+ //
+ if ((ifr.ifr_flags & IFF_PROMISC) == 0)
+ {
+ NS_FATAL_ERROR ("EmuNetDevice::StartDevice(): " << m_deviceName << " is not in promiscuous mode");
+ }
+
+ //
+ // Now spin up a read thread to read packets.
+ //
+ if (m_readThread != 0)
+ {
+ NS_FATAL_ERROR ("EmuNetDevice::StartDevice(): Receive thread is already running");
+ }
+
+ NS_LOG_LOGIC ("Spinning up read thread");
+
+ m_readThread = Create (MakeCallback (&EmuNetDevice::ReadThread, this));
+ m_readThread->Start ();
+
+ NotifyLinkUp ();
+}
+
+void
+EmuNetDevice::CreateSocket (void)
+{
+ NS_LOG_FUNCTION_NOARGS ();
+ //
+ // We want to create a raw socket for our net device. Unfortunately for us
+ // you have to have root privileges to do that. Instead of running the
+ // entire simulation as root, we decided to make a small program who's whole
+ // reason for being is to run as suid root and create a raw socket. We're
+ // going to fork and exec that program soon, but we need to have a socket
+ // to talk to it with. So we create a local interprocess (Unix) socket
+ // for that purpose.
+ //
+ int sock = socket (PF_UNIX, SOCK_DGRAM, 0);
+ if (sock == -1)
+ {
+ NS_FATAL_ERROR ("EmuNetDevice::CreateSocket(): Unix socket creation error, errno = " << strerror (errno));
+ }
+
+ //
+ // Bind to that socket and let the kernel allocate an endpoint
+ //
+ struct sockaddr_un un;
+ memset (&un, 0, sizeof (un));
+ un.sun_family = AF_UNIX;
+ int status = bind (sock, (struct sockaddr*)&un, sizeof (sa_family_t));
+ if (status == -1)
+ {
+ NS_FATAL_ERROR ("EmuNetDevice::CreateSocket(): Could not bind(): errno = " << strerror (errno));
+ }
+
+ NS_LOG_INFO ("Created Unix socket");
+ NS_LOG_INFO ("sun_family = " << un.sun_family);
+ NS_LOG_INFO ("sun_path = " << un.sun_path);
+
+ //
+ // We have a socket here, but we want to get it there -- to the program we're
+ // going to exec. What we'll do is to do a getsockname and then encode the
+ // resulting address information as a string, and then send the string to the
+ // program as an argument. So we need to get the sock name.
+ //
+ socklen_t len = sizeof (un);
+ status = getsockname (sock, (struct sockaddr*)&un, &len);
+ if (status == -1)
+ {
+ NS_FATAL_ERROR ("EmuNetDevice::CreateSocket(): Could not getsockname(): errno = " << strerror (errno));
+ }
+
+ //
+ // Now encode that socket name (family and path) as a string of hex digits
+ //
+ std::string path = EmuBufferToString((uint8_t *)&un, len);
+ NS_LOG_INFO ("Encoded Unix socket as \"" << path << "\"");
+ //
+ // Fork and exec the process to create our socket. If we're us (the parent)
+ // we wait for the child (the socket creator) to complete and read the
+ // socket it created using the ancillary data mechanism.
+ //
+ pid_t pid = ::fork ();
+ if (pid == 0)
+ {
+ NS_LOG_DEBUG ("Child process");
+
+ //
+ // build a command line argument from the encoded endpoint string that
+ // the socket creation process will use to figure out how to respond to
+ // the (now) parent process.
+ //
+ std::ostringstream oss;
+ oss << "-p" << path;
+ NS_LOG_INFO ("Parameters set to \"" << oss.str () << "\"");
+
+ //
+ // Execute the socket creation process image.
+ //
+ status = ::execl (FindCreator ().c_str (), "emu-sock-creator", oss.str ().c_str (), (char *)NULL);
+
+ //
+ // If the execl successfully completes, it never returns. If it returns it failed or the OS is
+ // broken. In either case, we bail.
+ //
+ NS_FATAL_ERROR ("EmuNetDevice::CreateSocket(): Back from execl(), errno = " << ::strerror (errno));
+ }
+ else
+ {
+ NS_LOG_DEBUG ("Parent process");
+ //
+ // We're the process running the emu net device. We need to wait for the
+ // socket creator process to finish its job.
+ //
+ int st;
+ pid_t waited = waitpid (pid, &st, 0);
+ if (waited == -1)
+ {
+ NS_FATAL_ERROR ("EmuNetDevice::CreateSocket(): waitpid() fails, errno = " << strerror (errno));
+ }
+ NS_ASSERT_MSG (pid == waited, "EmuNetDevice::CreateSocket(): pid mismatch");
+
+ //
+ // Check to see if the socket creator exited normally and then take a
+ // look at the exit code. If it bailed, so should we. If it didn't
+ // even exit normally, we bail too.
+ //
+ if (WIFEXITED (st))
+ {
+ int exitStatus = WEXITSTATUS (st);
+ if (exitStatus != 0)
+ {
+ NS_FATAL_ERROR ("EmuNetDevice::CreateSocket(): socket creator exited normally with status " << exitStatus);
+ }
+ }
+ else
+ {
+ NS_FATAL_ERROR ("EmuNetDevice::CreateSocket(): socket creator exited abnormally");
+ }
+
+ //
+ // At this point, the socket creator has run successfully and should
+ // have created our raw socket and sent it back to the socket address
+ // we provided. Our socket should be waiting on the Unix socket. We've
+ // got to do a bunch of grunto work to get at it, though.
+ //
+ // The struct iovec below is part of a scatter-gather list. It describes a
+ // buffer. In this case, it describes a buffer (an integer) that will
+ // get the data that comes back from the socket creator process. It will
+ // be a magic number that we use as a consistency/sanity check.
+ //
+ struct iovec iov;
+ uint32_t magic;
+ iov.iov_base = &magic;
+ iov.iov_len = sizeof(magic);
+
+ //
+ // The CMSG macros you'll see below are used to create and access control
+ // messages (which is another name for ancillary data). The ancillary
+ // data is made up of pairs of struct cmsghdr structures and associated
+ // data arrays.
+ //
+ // First, we're going to allocate a buffer on the stack to receive our
+ // data array (that contains the socket). Sometimes you'll see this called
+ // an "ancillary element" but the msghdr uses the control message termimology
+ // so we call it "control."
+ //
+ size_t msg_size = sizeof(int);
+ char control[CMSG_SPACE(msg_size)];
+
+ //
+ // There is a msghdr that is used to minimize the number of parameters
+ // passed to recvmsg (which we will use to receive our ancillary data).
+ // This structure uses terminology corresponding to control messages, so
+ // you'll see msg_control, which is the pointer to the ancillary data and
+ // controllen which is the size of the ancillary data array.
+ //
+ // So, initialize the message header that describes the ancillary/control
+ // data we expect to receive and point it to buffer.
+ //
+ struct msghdr msg;
+ msg.msg_name = 0;
+ msg.msg_namelen = 0;
+ msg.msg_iov = &iov;
+ msg.msg_iovlen = 1;
+ msg.msg_control = control;
+ msg.msg_controllen = sizeof (control);
+ msg.msg_flags = 0;
+
+ //
+ // Now we can actually receive the interesting bits from the socket
+ // creator process.
+ //
+ ssize_t bytesRead = recvmsg (sock, &msg, 0);
+ if (bytesRead != sizeof(int))
+ {
+ NS_FATAL_ERROR ("EmuNetDevice::CreateSocket(): Wrong byte count from socket creator");
+ }
+
+ //
+ // There may be a number of message headers/ancillary data arrays coming in.
+ // Let's look for the one with a type SCM_RIGHTS which indicates it' the
+ // one we're interested in.
+ //
+ struct cmsghdr *cmsg;
+ for (cmsg = CMSG_FIRSTHDR(&msg); cmsg != NULL; cmsg = CMSG_NXTHDR(&msg, cmsg))
+ {
+ if (cmsg->cmsg_level == SOL_SOCKET &&
+ cmsg->cmsg_type == SCM_RIGHTS)
+ {
+ //
+ // This is the type of message we want. Check to see if the magic
+ // number is correct and then pull out the socket we care about if
+ // it matches
+ //
+ if (magic == EMU_MAGIC)
+ {
+ NS_LOG_INFO ("Got SCM_RIGHTS with correct magic " << magic);
+ int *rawSocket = (int*)CMSG_DATA (cmsg);
+ NS_LOG_INFO ("Got the socket from the socket creator = " << *rawSocket);
+ m_sock = *rawSocket;
+ return;
+ }
+ else
+ {
+ NS_LOG_INFO ("Got SCM_RIGHTS, but with bad magic " << magic);
+ }
+ }
+ }
+ NS_FATAL_ERROR ("Did not get the raw socket from the socket creator");
+ }
+}
+
+std::string
+EmuNetDevice::FindCreator (void)
+{
+ struct stat st;
+ std::string debug = "./build/debug/src/devices/emu/emu-sock-creator";
+ std::string optimized = "./build/optimized/src/devices/emu/emu-sock-creator";
+
+ if (::stat (debug.c_str (), &st) == 0)
+ {
+ return debug;
+ }
+
+ if (::stat (optimized.c_str (), &st) == 0)
+ {
+ return optimized;
+ }
+
+ NS_FATAL_ERROR ("EmuNetDevice::FindCreator(): Couldn't find creator");
+ return ""; // quiet compiler
+}
+
+void
+EmuNetDevice::StopDevice (void)
+{
+ NS_LOG_FUNCTION_NOARGS ();
+
+ close (m_sock);
+ m_sock = -1;
+
+ NS_ASSERT_MSG (m_readThread != 0, "EmuNetDevice::StopDevice(): Receive thread is not running");
+
+ NS_LOG_LOGIC ("Joining read thread");
+ m_readThread->Join ();
+ m_readThread = 0;
+}
+
+void
+EmuNetDevice::ForwardUp (uint8_t *buf, uint32_t len)
+{
+ NS_LOG_FUNCTION (buf << len);
+
+ //
+ // Create a packet out of the buffer we received and free that buffer.
+ //
+ Ptr packet = Create (reinterpret_cast (buf), len);
+ free (buf);
+ buf = 0;
+
+ //
+ // Trace sinks will expect complete packets, not packets without some of the
+ // headers.
+ //
+ Ptr originalPacket = packet->Copy ();
+
+ //
+ // Checksum the packet
+ //
+ EthernetTrailer trailer;
+ packet->RemoveTrailer (trailer);
+ trailer.CheckFcs (packet);
+
+ EthernetHeader header (false);
+ packet->RemoveHeader (header);
+
+ NS_LOG_LOGIC ("Pkt source is " << header.GetSource ());
+ NS_LOG_LOGIC ("Pkt destination is " << header.GetDestination ());
+
+ LlcSnapHeader llc;
+ packet->RemoveHeader (llc);
+ uint16_t protocol = llc.GetType ();
+
+ PacketType packetType;
+
+ if (header.GetDestination ().IsBroadcast ())
+ {
+ NS_LOG_LOGIC ("Pkt destination is PACKET_BROADCAST");
+ packetType = NS3_PACKET_BROADCAST;
+ }
+ else if (header.GetDestination ().IsMulticast ())
+ {
+ NS_LOG_LOGIC ("Pkt destination is PACKET_MULTICAST");
+ packetType = NS3_PACKET_MULTICAST;
+ }
+ else if (header.GetDestination () == m_address)
+ {
+ NS_LOG_LOGIC ("Pkt destination is PACKET_HOST");
+ packetType = NS3_PACKET_HOST;
+ }
+ else
+ {
+ NS_LOG_LOGIC ("Pkt destination is PACKET_OTHERHOST");
+ packetType = NS3_PACKET_OTHERHOST;
+ }
+
+ if (!m_promiscRxCallback.IsNull ())
+ {
+ NS_LOG_LOGIC ("calling m_promiscRxCallback");
+ m_promiscRxCallback (this, packet->Copy (), protocol, header.GetSource (), header.GetDestination (), packetType);
+ }
+
+ if (packetType != NS3_PACKET_OTHERHOST)
+ {
+ m_rxTrace (originalPacket);
+ NS_LOG_LOGIC ("calling m_rxCallback");
+ m_rxCallback (this, packet, protocol, header.GetSource ());
+ }
+}
+
+void
+EmuNetDevice::ReadThread (void)
+{
+ NS_LOG_FUNCTION_NOARGS ();
+
+ //
+ // It's important to remember that we're in a completely different thread than the simulator is running in. We
+ // need to synchronize with that other thread to get the packet up into ns-3. What we will need to do is to schedule
+ // a method to forward up the packet using the multithreaded simulator we are most certainly running. However, I just
+ // said it -- we are talking about two threads here, so it is very, very dangerous to do any kind of reference couning
+ // on a shared object. Just don't do it. So what we're going to do is to allocate a buffer on the heap and pass that
+ // buffer into the ns-3 context thread where it will create the packet.
+ //
+
+ int32_t len = -1;
+ struct sockaddr_ll addr;
+ socklen_t addrSize = sizeof (addr);
+
+ for (;;)
+ {
+ uint32_t bufferSize = 65536;
+ uint8_t *buf = (uint8_t *)malloc (bufferSize);
+ if (buf == 0)
+ {
+ NS_FATAL_ERROR ("EmuNetDevice::ReadThread(): malloc packet buffer failed");
+ }
+
+ NS_LOG_LOGIC ("Calling recvfrom");
+ len = recvfrom (m_sock, buf, bufferSize, 0, (struct sockaddr *)&addr, &addrSize);
+
+ if (len == -1)
+ {
+ free (buf);
+ buf = 0;
+ return;
+ }
+
+ NS_LOG_INFO ("EmuNetDevice::ReadThread(): Received packet");
+ NS_LOG_INFO ("EmuNetDevice::ReadThread(): Scheduling handler");
+ DynamicCast (Simulator::GetImplementation ())->ScheduleRealtimeNow (
+ MakeEvent (&EmuNetDevice::ForwardUp, this, buf, len));
+ buf = 0;
+ }
+}
+
+bool
+EmuNetDevice::Send (Ptr packet, const Address &dest, uint16_t protocolNumber)
+{
+ NS_LOG_FUNCTION (packet << dest << protocolNumber);
+ //
+ // The immediate questions here are how are we going to encapsulate packets and what do we use as the MAC source and
+ // destination (hardware) addresses?
+ //
+ // If we return false from EmuNetDevice::NeedsArp, the ArpIpv4Interface will pass the broadcast address as the
+ // hardware (Ethernet) destination by default. If we return true from EmuNetDevice::NeedsArp, then the hardware
+ // destination is actually meaningful, but we'll have an ns-3 ARP running on this device. There can also be an ARP
+ // running on the underlying OS so we have to be very careful, both about multiple ARPs and also about TCP, UDP, etc.
+ //
+ // We are operating in promiscuous mode on the receive side (all ns-3 net devices are required to implement the
+ // promiscuous callback in a meaningful way), so we have an option regarding the hardware addresses. We don't actually have
+ // to use the real hardware addresses and IP addresses of the underlying system. We can completely use MAC-spoofing to
+ // fake out the OS by using the ns-3 assigned MAC address (and also the ns-3 assigned IP addresses). Ns-3 starts its
+ // MAC address allocation using the OUI (vendor-code) 00:00:00 which is unassigned to any organization and is a globally
+ // administered address, so there shouldn't be any collisions with real hardware.
+ //
+ // So what we do is we return true from EmuNetDevice::NeedsArp which tells ns-3 to use its own ARP. We spoof the
+ // MAC address of the device and use promiscuous mode to receive traffic destined to that address.
+ //
+ return SendFrom (packet, m_address, dest, protocolNumber);
+}
+
+bool
+EmuNetDevice::SendFrom (Ptr packet, const Address &src, const Address &dest, uint16_t protocolNumber)
+{
+ NS_LOG_FUNCTION (packet << src << dest << protocolNumber);
+
+ if (IsLinkUp () == false)
+ {
+ NS_LOG_LOGIC ("Link is down, returning");
+ return false;
+ }
+
+ Mac48Address destination = Mac48Address::ConvertFrom (dest);
+ Mac48Address source = Mac48Address::ConvertFrom (src);
+
+ NS_LOG_LOGIC ("Transmit packet with UID " << packet->GetUid ());
+ NS_LOG_LOGIC ("Transmit packet from " << source);
+ NS_LOG_LOGIC ("Transmit packet to " << destination);
+
+#if 0
+ {
+ struct ifreq ifr;
+ bzero (&ifr, sizeof(ifr));
+ strncpy ((char *)ifr.ifr_name, m_deviceName.c_str (), IFNAMSIZ);
+
+ NS_LOG_LOGIC ("Getting MAC address");
+ int32_t rc = ioctl (m_sock, SIOCGIFHWADDR, &ifr);
+ if (rc == -1)
+ {
+ NS_FATAL_ERROR ("EmuNetDevice::SendFrom(): Can't get MAC address");
+ }
+
+ std::ostringstream oss;
+ oss << std::hex <<
+ (ifr.ifr_hwaddr.sa_data[0] & 0xff) << ":" <<
+ (ifr.ifr_hwaddr.sa_data[1] & 0xff) << ":" <<
+ (ifr.ifr_hwaddr.sa_data[2] & 0xff) << ":" <<
+ (ifr.ifr_hwaddr.sa_data[3] & 0xff) << ":" <<
+ (ifr.ifr_hwaddr.sa_data[4] & 0xff) << ":" <<
+ (ifr.ifr_hwaddr.sa_data[5] & 0xff) << std::dec;
+
+ NS_LOG_LOGIC ("Fixup source to HW MAC " << oss.str ());
+ source = Mac48Address (oss.str ().c_str ());
+ NS_LOG_LOGIC ("source now " << source);
+ }
+#endif
+
+ LlcSnapHeader llc;
+ llc.SetType (protocolNumber);
+ packet->AddHeader (llc);
+
+ EthernetHeader header (false);
+ header.SetSource (source);
+ header.SetDestination (destination);
+ header.SetLengthType (packet->GetSize ());
+ packet->AddHeader (header);
+
+ EthernetTrailer trailer;
+ trailer.CalcFcs (packet);
+ packet->AddTrailer (trailer);
+
+ //
+ // Enqueue and dequeue the packet to hit the tracing hooks.
+ //
+ m_queue->Enqueue (packet);
+ packet = m_queue->Dequeue ();
+
+ struct sockaddr_ll ll;
+ bzero (&ll, sizeof (ll));
+
+ ll.sll_family = AF_PACKET;
+ ll.sll_ifindex = m_sll_ifindex;
+ ll.sll_protocol = htons(ETH_P_ALL);
+
+ NS_LOG_LOGIC ("calling sendto");
+
+ int32_t rc;
+ rc = sendto (m_sock, packet->PeekData (), packet->GetSize (), 0, reinterpret_cast (&ll), sizeof (ll));
+
+ NS_LOG_LOGIC ("sendto returns " << rc);
+
+ return rc == -1 ? false : true;
+}
+
+void
+EmuNetDevice::SetDataRate(DataRate bps)
+{
+ NS_LOG_FUNCTION (this << bps);
+ NS_FATAL_ERROR ("EmuNetDevice::SetDataRate(): Unable.");
+}
+
+void
+EmuNetDevice::SetQueue (Ptr q)
+{
+ NS_LOG_FUNCTION (this << q);
+ m_queue = q;
+}
+
+Ptr
+EmuNetDevice::GetQueue(void) const
+{
+ NS_LOG_FUNCTION_NOARGS ();
+ return m_queue;
+}
+
+void
+EmuNetDevice::NotifyLinkUp (void)
+{
+ m_linkUp = true;
+ if (!m_linkChangeCallback.IsNull ())
+ {
+ m_linkChangeCallback ();
+ }
+}
+
+void
+EmuNetDevice::SetName(const std::string name)
+{
+ m_name = name;
+}
+
+std::string
+EmuNetDevice::GetName(void) const
+{
+ return m_name;
+}
+
+void
+EmuNetDevice::SetIfIndex(const uint32_t index)
+{
+ m_ifIndex = index;
+}
+
+uint32_t
+EmuNetDevice::GetIfIndex(void) const
+{
+ return m_ifIndex;
+}
+
+Ptr
+EmuNetDevice::GetChannel (void) const
+{
+ NS_FATAL_ERROR ("EmuNetDevice::GetChannel(): Unable.");
+ return 0;
+}
+
+void
+EmuNetDevice::SetAddress (Mac48Address addr)
+{
+ NS_LOG_FUNCTION (addr);
+ m_address = addr;
+}
+
+Address
+EmuNetDevice::GetAddress (void) const
+{
+ NS_LOG_FUNCTION_NOARGS ();
+ return m_address;
+}
+
+bool
+EmuNetDevice::SetMtu (const uint16_t mtu)
+{
+ NS_FATAL_ERROR ("EmuNetDevice::SetMtu(): Unable.");
+ return false;
+}
+
+uint16_t
+EmuNetDevice::GetMtu (void) const
+{
+ struct ifreq ifr;
+ bzero (&ifr, sizeof (ifr));
+ strcpy(ifr.ifr_name, m_deviceName.c_str ());
+
+ int32_t fd = socket(PF_INET, SOCK_DGRAM, IPPROTO_IP);
+
+
+ int32_t rc = ioctl(fd, SIOCGIFMTU, &ifr);
+ if (rc == -1)
+ {
+ NS_FATAL_ERROR ("EmuNetDevice::GetMtu(): Can't ioctl SIOCGIFMTU");
+ }
+
+ close (fd);
+
+ return ifr.ifr_mtu;
+}
+
+bool
+EmuNetDevice::IsLinkUp (void) const
+{
+ return m_linkUp;
+}
+
+void
+EmuNetDevice::SetLinkChangeCallback (Callback callback)
+{
+ m_linkChangeCallback = callback;
+}
+
+bool
+EmuNetDevice::IsBroadcast (void) const
+{
+ return true;
+}
+
+Address
+EmuNetDevice::GetBroadcast (void) const
+{
+ return Mac48Address ("ff:ff:ff:ff:ff:ff");
+}
+
+bool
+EmuNetDevice::IsMulticast (void) const
+{
+ return false;
+}
+
+ Address
+EmuNetDevice::GetMulticast (Ipv4Address multicastGroup) const
+{
+ NS_LOG_FUNCTION (multicastGroup);
+
+ Mac48Address ad = Mac48Address::GetMulticast (multicastGroup);
+
+ //
+ // Implicit conversion (operator Address ()) is defined for Mac48Address, so
+ // use it by just returning the EUI-48 address which is automagically converted
+ // to an Address.
+ //
+ NS_LOG_LOGIC ("multicast address is " << ad);
+
+ return ad;
+}
+
+Address
+EmuNetDevice::GetMulticast (Ipv6Address addr) const
+{
+ NS_LOG_FUNCTION(this << addr);
+
+ Mac48Address ad = Mac48Address::GetMulticast (addr);
+ NS_LOG_LOGIC("MAC IPv6 multicast address is " << ad);
+
+ return ad;
+}
+
+bool
+EmuNetDevice::IsPointToPoint (void) const
+{
+ return false;
+}
+
+void
+EmuNetDevice::SetPromiscReceiveCallback (PromiscReceiveCallback cb)
+{
+ NS_FATAL_ERROR ("EmuNetDevice::SetPromiscReceiveCallback(): Not implemented");
+}
+
+ bool
+EmuNetDevice::SupportsSendFrom () const
+{
+ NS_LOG_FUNCTION_NOARGS ();
+ return true;
+}
+
+
+Ptr
+EmuNetDevice::GetNode (void) const
+{
+ return m_node;
+}
+
+void
+EmuNetDevice::SetNode (Ptr node)
+{
+ m_node = node;
+}
+
+bool
+EmuNetDevice::NeedsArp (void) const
+{
+ return true;
+}
+
+void
+EmuNetDevice::SetReceiveCallback (NetDevice::ReceiveCallback cb)
+{
+ m_rxCallback = cb;
+}
+
+} // namespace ns3
diff --git a/src/devices/emu/emu-net-device.h b/src/devices/emu/emu-net-device.h
new file mode 100644
index 000000000..a2a04277f
--- /dev/null
+++ b/src/devices/emu/emu-net-device.h
@@ -0,0 +1,349 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/*
+ * Copyright (c) 2008 University of Washington
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation;
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef EMU_NET_DEVICE_H
+#define EMU_NET_DEVICE_H
+
+#include
+#include "ns3/address.h"
+#include "ns3/net-device.h"
+#include "ns3/node.h"
+#include "ns3/callback.h"
+#include "ns3/packet.h"
+#include "ns3/traced-callback.h"
+#include "ns3/event-id.h"
+#include "ns3/nstime.h"
+#include "ns3/data-rate.h"
+#include "ns3/ptr.h"
+#include "ns3/mac48-address.h"
+#include "ns3/system-thread.h"
+
+namespace ns3 {
+
+class Queue;
+
+/**
+ * \class EmuNetDevice
+ * \brief A Device for an Emu Network Link.
+ */
+class EmuNetDevice : public NetDevice
+{
+public:
+ static TypeId GetTypeId (void);
+
+ /**
+ * Construct a EmuNetDevice
+ *
+ * This is the constructor for the EmuNetDevice. It takes as a
+ */
+ EmuNetDevice ();
+
+ /**
+ * Destroy a EmuNetDevice
+ *
+ * This is the destructor for the EmuNetDevice.
+ */
+ virtual ~EmuNetDevice ();
+
+ /**
+ * Set the Data Rate used for transmission of packets.
+ *
+ * @see Attach ()
+ * @param bps the data rate at which this object operates
+ */
+ void SetDataRate (DataRate bps);
+
+ /**
+ * Set a start time for the device.
+ *
+ * @param tStart the start time
+ */
+ void Start (Time tStart);
+
+ /**
+ * Set a stop time for the device.
+ *
+ * @param tStop the stop time
+ */
+ void Stop (Time tStop);
+
+ /**
+ * Attach a queue to the EmuNetDevice.
+ *
+ * The EmuNetDevice "owns" a queue that implements a queueing
+ * method such as DropTail or RED.
+ *
+ * @see Queue
+ * @see DropTailQueue
+ * @param queue Ptr to the new queue.
+ */
+ void SetQueue (Ptr queue);
+
+ /**
+ * Assign a MAC address to this device.
+ *
+ * @see Mac48Address
+ * @param addr The new address.
+ */
+ void SetAddress (Mac48Address addr);
+
+//
+// Pure virtual methods inherited from NetDevice we must implement.
+//
+ virtual void SetName(const std::string name);
+ virtual std::string GetName(void) const;
+
+ virtual void SetIfIndex(const uint32_t index);
+ virtual uint32_t GetIfIndex(void) const;
+
+ virtual Ptr GetChannel (void) const;
+ virtual Address GetAddress (void) const;
+
+ virtual bool SetMtu (const uint16_t mtu);
+ virtual uint16_t GetMtu (void) const;
+
+ virtual bool IsLinkUp (void) const;
+
+ virtual void SetLinkChangeCallback (Callback callback);
+
+ virtual bool IsBroadcast (void) const;
+ virtual Address GetBroadcast (void) const;
+
+ virtual bool IsMulticast (void) const;
+
+ /**
+ * \brief Make and return a MAC multicast address using the provided
+ * multicast group
+ *
+ * RFC 1112 says that an Ipv4 host group address is mapped to an Ethernet
+ * multicast address by placing the low-order 23-bits of the IP address into
+ * the low-order 23 bits of the Ethernet multicast address
+ * 01-00-5E-00-00-00 (hex).
+ *
+ * This method performs the multicast address creation function appropriate
+ * to an EUI-48-based CSMA device. This MAC address is encapsulated in an
+ * abstract Address to avoid dependencies on the exact address format.
+ *
+ * \param multicastGroup The IP address for the multicast group destination
+ * of the packet.
+ * \return The MAC multicast Address used to send packets to the provided
+ * multicast group.
+ *
+ * \see Ipv4Address
+ * \see Mac48Address
+ * \see Address
+ */
+ virtual Address GetMulticast (Ipv4Address multicastGroup) const;
+
+ /**
+ * \brief Get the MAC multicast address corresponding
+ * to the IPv6 address provided.
+ * \param addr IPv6 address
+ * \return the MAC multicast address
+ * \warning Calling this method is invalid if IsMulticast returns not true.
+ */
+ virtual Address GetMulticast (Ipv6Address addr) const;
+
+ /**
+ * Is this a point to point link?
+ * \returns false.
+ */
+ virtual bool IsPointToPoint (void) const;
+
+ virtual bool Send(Ptr packet, const Address &dest, uint16_t protocolNumber);
+
+ virtual bool SendFrom(Ptr packet, const Address& source, const Address& dest, uint16_t protocolNumber);
+
+ virtual Ptr GetNode (void) const;
+ virtual void SetNode (Ptr node);
+
+ virtual bool NeedsArp (void) const;
+
+ virtual void SetReceiveCallback (NetDevice::ReceiveCallback cb);
+ virtual void SetPromiscReceiveCallback (PromiscReceiveCallback cb);
+
+ virtual bool SupportsSendFrom (void) const;
+
+private:
+
+ virtual void DoDispose (void);
+
+ /**
+ * Call out to a separate process running as suid root in order to get a raw
+ * socket. We do this to avoid having the entire simulation running as root.
+ * If this method returns, we'll have a raw socket waiting for us in m_sock.
+ */
+ void CreateSocket (void);
+
+ /**
+ * Figure out where the raw socket creation process lives on the system.
+ */
+ std::string FindCreator (void);
+
+ /**
+ * Get a copy of the attached Queue.
+ *
+ * This method is provided for any derived class that may need to get
+ * direct access to the underlying queue.
+ *
+ * @returns Ptr to the queue.
+ */
+ Ptr GetQueue(void) const;
+
+ /**
+ * Spin up the device
+ */
+ void StartDevice (void);
+
+ /**
+ * Tear down the device
+ */
+ void StopDevice (void);
+
+ /**
+ * Loop to read and process packets
+ */
+ void ReadThread (void);
+
+ /**
+ * Method to handle received packets. Synchronized with simulator via ScheduleNow from ReadThread.
+ */
+ void ForwardUp (uint8_t *buf, uint32_t len);
+
+ /**
+ * Adds the necessary headers and trailers to a packet of data in order to
+ * respect the protocol implemented by the agent.
+ */
+ void AddHeader(Ptr p, uint16_t protocolNumber);
+
+ /**
+ * Removes, from a packet of data, all headers and trailers that
+ * relate to the protocol implemented by the agent
+ * \return Returns true if the packet should be forwarded up the
+ * protocol stack.
+ */
+ bool ProcessHeader(Ptr p, uint16_t& param);
+
+ /**
+ * Start Sending a Packet Down the Wire.
+ *
+ * @returns true if success, false on failure
+ */
+ bool TransmitStart (Ptr p);
+
+ void NotifyLinkUp (void);
+
+ /**
+ * The Queue which this EmuNetDevice uses as a packet source.
+ * Management of this Queue has been delegated to the EmuNetDevice
+ * and it has the responsibility for deletion.
+ * @see class Queue
+ * @see class DropTailQueue
+ */
+ Ptr m_queue;
+
+ /**
+ * The trace source for the packet reception events that the device can
+ * fire.
+ *
+ * @see class CallBackTraceSource
+ */
+ TracedCallback > m_rxTrace;
+
+ /**
+ * The trace source for the packet drop events that the device can
+ * fire.
+ *
+ * @see class CallBackTraceSource
+ */
+ TracedCallback > m_dropTrace;
+
+ /**
+ * Time to start spinning up the device
+ */
+ Time m_tStart;
+
+ /**
+ * Time to start tearing down the device
+ */
+ Time m_tStop;
+
+ EventId m_startEvent;
+ EventId m_stopEvent;
+
+ int32_t m_sock;
+
+ Ptr m_readThread;
+
+ /**
+ * The Node to which this device is attached.
+ */
+ Ptr m_node;
+
+ /**
+ * The MAC address which has been assigned to this device.
+ */
+ Mac48Address m_address;
+
+ /**
+ * The callback used to notify higher layers that a packet has been received.
+ */
+ NetDevice::ReceiveCallback m_rxCallback;
+
+ /**
+ * The callback used to notify higher layers that a packet has been received in promiscuous mode.
+ */
+ NetDevice::PromiscReceiveCallback m_promiscRxCallback;
+
+ /**
+ * The ns-3 interface index (in the sense of net device index) that has been assigned to this network device.
+ */
+ uint32_t m_ifIndex;
+
+ /**
+ * The Unix interface index that we got from the system and which corresponds to the interface (e.g., "eth1")
+ * we are using to talk to the network. Valid when m_sock is valid.
+ */
+ int32_t m_sll_ifindex;
+
+ /**
+ * The human readable name of this device.
+ */
+ std::string m_name;
+
+ /**
+ * Flag indicating whether or not the link is up. In this case,
+ * whether or not the device is connected to a channel.
+ */
+ bool m_linkUp;
+
+ /**
+ * Callback to fire if the link changes state (up or down).
+ */
+ Callback m_linkChangeCallback;
+
+ /**
+ * The unix/linux name of the underlying device (e.g., eth0)
+ */
+ std::string m_deviceName;
+};
+
+} // namespace ns3
+
+#endif // EMU_NET_DEVICE_H
+
diff --git a/src/devices/emu/emu-sock-creator.cc b/src/devices/emu/emu-sock-creator.cc
new file mode 100644
index 000000000..21850e400
--- /dev/null
+++ b/src/devices/emu/emu-sock-creator.cc
@@ -0,0 +1,246 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/*
+ * Copyright (c) University of Washington
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation;
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+#include "emu-encode-decode.h"
+
+#define EMU_MAGIC 65867
+
+static int gVerbose = 0;
+
+#define LOG(msg) \
+ if (gVerbose) \
+ { \
+ std::cout << __FUNCTION__ << "(): " << msg << std::endl; \
+ }
+
+#define ABORT(msg, printErrno) \
+ std::cout << __FILE__ << ": fatal error at line " << __LINE__ << ": " << __FUNCTION__ << "(): " << msg << std::endl; \
+ if (printErrno) \
+ { \
+ std::cout << " errno = " << errno << " (" << strerror (errno) << ")" << std::endl; \
+ } \
+ exit (-1);
+
+#define ABORT_IF(cond, msg, printErrno) \
+ if (cond) \
+ { \
+ ABORT(msg, printErrno); \
+ }
+
+/**
+ * \brief Send the socket file descriptor we created back to the emu device,
+ * which will read it as soon as we're done.
+ *
+ * \param path The socket address information from the Unix socket we use
+ * to send the created socket back to.
+ * \param fd The socket we're going to send.
+ */
+ static void
+SendSocket (const char *path, int fd)
+{
+ //
+ // Open a Unix (local interprocess) socket to call back to the emu net
+ // device.
+ //
+ LOG ("Create Unix socket");
+ int sock = socket (PF_UNIX, SOCK_DGRAM, 0);
+ ABORT_IF (sock == -1, "Unable to open socket", 1);
+
+ //
+ // We have this string called path, which is really a hex representation
+ // of the endpoint that the net device created. It used a forward encoding
+ // method (EmuBufferToString) to take the sockaddr_un it made and passed
+ // the resulting string to us. So we need to take the inverse method
+ // (EmuStringToBuffer) and build the same sockaddr_un over here.
+ //
+ socklen_t clientAddrLen;
+ struct sockaddr_un clientAddr;
+
+ LOG ("Decode address " << path);
+ bool rc = ns3::EmuStringToBuffer (path, (uint8_t *)&clientAddr, &clientAddrLen);
+ ABORT_IF (rc == false, "Unable to decode path", 0);
+
+ LOG ("Connect");
+ int status = connect (sock, (struct sockaddr*)&clientAddr, clientAddrLen);
+ ABORT_IF (status == -1, "Unable to connect to emu device", 1);
+
+ LOG ("Connected");
+
+ //
+ // This is arcane enough that a few words are worthwhile to explain what's
+ // going on here.
+ //
+ // The interesting information (the socket FD) is going to go back to the
+ // emu net device as an integer of ancillary data. Ancillary data is bits
+ // that are not a part a socket payload (out-of-band data). We're also
+ // going to send one integer back. It's just initialized to a magic number
+ // we use to make sure that the emu device is talking to the emu socket
+ // creator and not some other creator process.
+ //
+ // The struct iovec below is part of a scatter-gather list. It describes a
+ // buffer. In this case, it describes a buffer (an integer) containing the
+ // data that we're going to send back to the emu net device (that magic
+ // number).
+ //
+ struct iovec iov;
+ uint32_t magic = EMU_MAGIC;
+ iov.iov_base = &magic;
+ iov.iov_len = sizeof(magic);
+
+ //
+ // The CMSG macros you'll see below are used to create and access control
+ // messages (which is another name for ancillary data). The ancillary
+ // data is made up of pairs of struct cmsghdr structures and associated
+ // data arrays.
+ //
+ // First, we're going to allocate a buffer on the stack to contain our
+ // data array (that contains the socket). Sometimes you'll see this called
+ // an "ancillary element" but the msghdr uses the control message termimology
+ // so we call it "control."
+ //
+ size_t msg_size = sizeof(int);
+ char control[CMSG_SPACE(msg_size)];
+
+ //
+ // There is a msghdr that is used to minimize the number of parameters
+ // passed to sendmsg (which we will use to send our ancillary data). This
+ // structure uses terminology corresponding to control messages, so you'll
+ // see msg_control, which is the pointer to the ancillary data and controllen
+ // which is the size of the ancillary data array.
+ //
+ // So, initialize the message header that describes our ancillary/control data
+ // and point it to the control message/ancillary data we just allocated space
+ // for.
+ //
+ struct msghdr msg;
+ msg.msg_name = 0;
+ msg.msg_namelen = 0;
+ msg.msg_iov = &iov;
+ msg.msg_iovlen = 1;
+ msg.msg_control = control;
+ msg.msg_controllen = sizeof (control);
+ msg.msg_flags = 0;
+
+ //
+ // A cmsghdr contains a length field that is the length of the header and
+ // the data. It has a cmsg_level field corresponding to the originating
+ // protocol. This takes values which are legal levels for getsockopt and
+ // setsockopt (here SOL_SOCKET). We're going to use the SCM_RIGHTS type of
+ // cmsg, that indicates that the ancillary data array contains access rights
+ // that we are sending back to the emu net device.
+ //
+ // We have to put together the first (and only) cmsghdr that will describe
+ // the whole package we're sending.
+ //
+ struct cmsghdr *cmsg;
+ cmsg = CMSG_FIRSTHDR(&msg);
+ cmsg->cmsg_level = SOL_SOCKET;
+ cmsg->cmsg_type = SCM_RIGHTS;
+ cmsg->cmsg_len = CMSG_LEN(msg_size);
+ //
+ // We also have to update the controllen in case other stuff is actually
+ // in there we may not be aware of (due to macros).
+ //
+ msg.msg_controllen = cmsg->cmsg_len;
+
+ //
+ // Finally, we get a pointer to the start of the ancillary data array and
+ // put our file descriptor in.
+ //
+ int *fdptr = (int*) (CMSG_DATA(cmsg));
+ *fdptr = fd; //
+
+ //
+ // Actually send the file descriptor back to the emulated net device.
+ //
+ ssize_t len = sendmsg(sock, &msg, 0);
+ ABORT_IF (len == -1, "Could not send socket back to emu net device", 1);
+
+ LOG ("sendmsg complete");
+}
+
+ int
+main (int argc, char *argv[])
+{
+ int c;
+ char *path = NULL;
+
+ opterr = 0;
+
+ while ((c = getopt (argc, argv, "vp:")) != -1)
+ {
+ switch (c)
+ {
+ case 'v':
+ gVerbose = true;
+ break;
+ case 'p':
+ path = optarg;
+ break;
+ }
+ }
+
+ //
+ // This program is spawned by an emu net device running in a simulation. It
+ // wants to create a raw socket as described below. We are going to do the
+ // work here since we're running suid root. Once we create the raw socket,
+ // we have to send it back to the emu net device. We do that over a Unix
+ // (local interprocess) socket. The emu net device created a socket to
+ // listen for our response on, and it is expected to have encoded the address
+ // information as a string and to have passed that string as an argument to
+ // us. We see it here as the "path" string. We can't do anything useful
+ // unless we have that string.
+ //
+ ABORT_IF (path == NULL, "path is a required argument", 0);
+ LOG ("Provided path is \"" << path << "\"");
+ //
+ // The whole reason for all of the hoops we went through to call out to this
+ // program will pay off here. We created this program to run as suid root
+ // in order to keep the main simulation program from having to be run with
+ // root privileges. We need root privileges to be able to open a raw socket
+ // though. So all of these hoops are to allow us to exeucte the following
+ // single line of code:
+ //
+ LOG ("Creating raw socket");
+ int sock = socket (PF_PACKET, SOCK_RAW, htons(ETH_P_ALL));
+ ABORT_IF (sock == -1, "CreateSocket(): Unable to open raw socket", 1);
+
+ //
+ // Send the socket back to the emu net device so it can go about its business
+ //
+ SendSocket (path, sock);
+
+ return 0;
+}
diff --git a/src/devices/emu/emu.h b/src/devices/emu/emu.h
new file mode 100644
index 000000000..ec25b241e
--- /dev/null
+++ b/src/devices/emu/emu.h
@@ -0,0 +1,60 @@
+/**
+ * \ingroup devices
+ * \defgroup Emulated Emulated Net Device Model
+ *
+ * \section Emulated Net Device Model
+ *
+ * The emulated net device allows a simulation node to send and receive packets
+ * a real network.
+ *
+ * The emulated net device relies on a specified interface being in promiscuous
+ * mode. It opens a raw socket and binds to that interface. We perform MAC
+ * spoofing to separate simulation network traffic from other network traffic
+ * that may be flowing to and from the host.
+ *
+ * Normally, the use case for emulated net devices is in collections of
+ * small simulations that connect to the outside world through specific
+ * interfaces. For example, one could construct a number of virtual
+ * machines and connect them via a host-only network. To use the emulated
+ * net device, you would need to set all of the host-only interfaces in
+ * promiscuous mode and provide an appropriate device name, "eth1" for example.
+ *
+ * One could also use the emulated net device in a testbed situation
+ * where the host on which the simulation is running has a specific interface
+ * of interest which drives the testbed hardware. You would also need to set
+ * this specific interface into promiscuous mode and provide an appropriate
+ * device name to the ns-3 emulated net device.
+ *
+ * The emulated net device only works if the underlying interface is up in
+ * promiscuous mode. We could just turn it on, but the situation is that we
+ * expect the other considerations listed above to have been dealt with.
+ * To verify that these issues are dealt with, we just make sure that the end
+ * result of that process has taken place and that the specified interface is
+ * in promiscuous mode.
+ *
+ * Packets will be sent out over the device, but we use MAC spoofing. The
+ * MAC addresses will be generated using the Organizationally Unique Identifier
+ * (OUI) 00:00:00 as a base. This vendor code is not assigned to any
+ * organization and so should not conflict with any real hardware.
+ *
+ * It is always up to you to determine that using these MAC addresses is
+ * okay on your network and won't conflict with anything else (including another
+ * simulation using emu devices) on your network. If you are using the
+ * emulated net device in separate simulations you must consider global MAC
+ * address assignment issues and ensure that MAC addresses are unique across
+ * all simulations. The emulated net device respects the MAC address provided
+ * in the SetAddress method so you can do this manually. For larger simulations,
+ * you may want to set the OUI in the MAC address allocation function.
+ *
+ * IP addresses corresponding to the emulated net devices are the addresses
+ * generated in the simulation, which are generated in the usual way via helper
+ * functions.
+ *
+ * The emulated net device comes with a helper function as all ns-3 devices do.
+ * One unique aspect is that there is no channel associated with the underlying
+ * medium. We really have no idea what this medium is, and so have not made an
+ * effort to model it abstractly. The primary thing to be aware of is the
+ * implication this has for static global routing. The global router module
+ * attempts to walk the channels looking for adjacent networks. Since there
+ * is no channel, the global router will be unable to do this.
+ */
diff --git a/src/devices/emu/waf b/src/devices/emu/waf
new file mode 100755
index 000000000..4283ec141
--- /dev/null
+++ b/src/devices/emu/waf
@@ -0,0 +1 @@
+exec "`dirname "$0"`"/../../../waf "$@"
diff --git a/src/devices/emu/wscript b/src/devices/emu/wscript
new file mode 100644
index 000000000..c3d14b3a2
--- /dev/null
+++ b/src/devices/emu/wscript
@@ -0,0 +1,39 @@
+## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
+
+def configure(conf):
+ e = conf.create_header_configurator()
+ e.mandatory = False
+ e.name = 'linux/if_ether.h'
+ e.define = 'HAVE_IF_ETHER_H'
+ conf.env['ENABLE_EMU'] = e.run()
+ conf.report_optional_feature("Low Level Ethernet Defintions", "Emulated Net Device",
+ conf.env['ENABLE_EMU'],
+ " include not detected")
+
+def build(bld):
+ module = bld.create_ns3_module('emu', ['node'])
+ module.source = [
+ ]
+ headers = bld.create_obj('ns3header')
+ headers.module = 'emu'
+ headers.source = [
+ 'emu.h',
+ ]
+
+ env = bld.env_of_name('default')
+ if env['ENABLE_EMU']:
+ module.source.extend([
+ 'emu-net-device.cc',
+ 'emu-encode-decode.cc',
+ ])
+ headers.source.extend([
+ 'emu-net-device.h',
+ ])
+
+ obj = bld.create_suid_program('emu-sock-creator')
+ obj.source = [
+ 'emu-sock-creator.cc',
+ 'emu-encode-decode.cc',
+ ]
+
+
diff --git a/src/devices/point-to-point/point-to-point-net-device.cc b/src/devices/point-to-point/point-to-point-net-device.cc
index 159d8a004..9d3628663 100644
--- a/src/devices/point-to-point/point-to-point-net-device.cc
+++ b/src/devices/point-to-point/point-to-point-net-device.cc
@@ -372,22 +372,17 @@ PointToPointNetDevice::IsMulticast (void) const
return false;
}
-//
-// Since we return false in the IsMulticast call, calls to other multicast
-// related methods returns are undefined according to the base class. So we
-// can freely make something up, which is the base of the MAC multicast
-// address space.
-//
Address
-PointToPointNetDevice::GetMulticast (void) const
+PointToPointNetDevice::GetMulticast (Ipv4Address multicastGroup) const
{
return Mac48Address ("01:00:5e:00:00:00");
}
- Address
-PointToPointNetDevice::MakeMulticastAddress (Ipv4Address multicastGroup) const
+Address
+PointToPointNetDevice::GetMulticast (Ipv6Address addr) const
{
- return Mac48Address ("01:00:5e:00:00:00");
+ NS_LOG_FUNCTION(this << addr);
+ return Mac48Address ("33:33:00:00:00:00");
}
bool
diff --git a/src/devices/point-to-point/point-to-point-net-device.h b/src/devices/point-to-point/point-to-point-net-device.h
index 67636fa71..c57241573 100644
--- a/src/devices/point-to-point/point-to-point-net-device.h
+++ b/src/devices/point-to-point/point-to-point-net-device.h
@@ -249,8 +249,7 @@ public:
virtual Address GetBroadcast (void) const;
virtual bool IsMulticast (void) const;
- virtual Address GetMulticast (void) const;
- virtual Address MakeMulticastAddress (Ipv4Address multicastGroup) const;
+ virtual Address GetMulticast (Ipv4Address multicastGroup) const;
virtual bool IsPointToPoint (void) const;
@@ -264,6 +263,8 @@ public:
virtual void SetReceiveCallback (NetDevice::ReceiveCallback cb);
+ virtual Address GetMulticast (Ipv6Address addr) const;
+
virtual void SetPromiscReceiveCallback (PromiscReceiveCallback cb);
virtual bool SupportsSendFrom (void) const;
diff --git a/src/devices/point-to-point/wscript b/src/devices/point-to-point/wscript
index e9861027d..31aa62ade 100644
--- a/src/devices/point-to-point/wscript
+++ b/src/devices/point-to-point/wscript
@@ -14,5 +14,6 @@ def build(bld):
headers.source = [
'point-to-point-net-device.h',
'point-to-point-channel.h',
+ 'ppp-header.h',
]
diff --git a/src/devices/wifi/wifi-net-device.cc b/src/devices/wifi/wifi-net-device.cc
index 6dbaf85cc..0b7c2afd8 100644
--- a/src/devices/wifi/wifi-net-device.cc
+++ b/src/devices/wifi/wifi-net-device.cc
@@ -224,15 +224,14 @@ WifiNetDevice::IsMulticast (void) const
return false;
}
Address
-WifiNetDevice::GetMulticast (void) const
-{
- return Mac48Address::GetMulticastPrefix ();
-}
-Address
-WifiNetDevice::MakeMulticastAddress (Ipv4Address multicastGroup) const
+WifiNetDevice::GetMulticast (Ipv4Address multicastGroup) const
{
return Mac48Address::GetMulticast (multicastGroup);
}
+Address WifiNetDevice::GetMulticast (Ipv6Address addr) const
+{
+ return Mac48Address::GetMulticast (addr);
+}
bool
WifiNetDevice::IsPointToPoint (void) const
{
diff --git a/src/devices/wifi/wifi-net-device.h b/src/devices/wifi/wifi-net-device.h
index 3585705d8..29afc476f 100644
--- a/src/devices/wifi/wifi-net-device.h
+++ b/src/devices/wifi/wifi-net-device.h
@@ -88,8 +88,7 @@ public:
virtual bool IsBroadcast (void) const;
virtual Address GetBroadcast (void) const;
virtual bool IsMulticast (void) const;
- virtual Address GetMulticast (void) const;
- virtual Address MakeMulticastAddress (Ipv4Address multicastGroup) const;
+ virtual Address GetMulticast (Ipv4Address multicastGroup) const;
virtual bool IsPointToPoint (void) const;
virtual bool Send(Ptr packet, const Address& dest, uint16_t protocolNumber);
virtual Ptr GetNode (void) const;
@@ -97,6 +96,8 @@ public:
virtual bool NeedsArp (void) const;
virtual void SetReceiveCallback (NetDevice::ReceiveCallback cb);
+ virtual Address GetMulticast (Ipv6Address addr) const;
+
virtual bool SendFrom(Ptr packet, const Address& source, const Address& dest, uint16_t protocolNumber);
virtual void SetPromiscReceiveCallback (PromiscReceiveCallback cb);
virtual bool SupportsSendFrom (void) const;
diff --git a/src/helper/application-container.cc b/src/helper/application-container.cc
index 0d4d86432..46a034c5c 100644
--- a/src/helper/application-container.cc
+++ b/src/helper/application-container.cc
@@ -21,6 +21,14 @@
namespace ns3 {
+ApplicationContainer::ApplicationContainer ()
+{}
+
+ApplicationContainer::ApplicationContainer (Ptr app)
+{
+ m_applications.push_back (app);
+}
+
ApplicationContainer::Iterator
ApplicationContainer::Begin (void) const
{
diff --git a/src/helper/application-container.h b/src/helper/application-container.h
index 1a7dac1ea..4988500d2 100644
--- a/src/helper/application-container.h
+++ b/src/helper/application-container.h
@@ -33,6 +33,18 @@ namespace ns3 {
class ApplicationContainer
{
public:
+ /**
+ * Create an empty ApplicationContainer.
+ */
+ ApplicationContainer ();
+
+ /**
+ * Create an ApplicationContainer with exactly one application
+ *
+ * \param node a node to add to the container
+ */
+ ApplicationContainer (Ptr application);
+
typedef std::vector >::const_iterator Iterator;
/**
diff --git a/src/helper/csma-helper.cc b/src/helper/csma-helper.cc
index b3ee71a60..586392d73 100644
--- a/src/helper/csma-helper.cc
+++ b/src/helper/csma-helper.cc
@@ -173,30 +173,51 @@ CsmaHelper::EnableAsciiAll (std::ostream &os)
EnableAscii (os, NodeContainer::GetGlobal ());
}
-
-NetDeviceContainer
-CsmaHelper::Install (const NodeContainer &c)
+NetDeviceContainer
+CsmaHelper::Install (Ptr node) const
{
Ptr channel = m_channelFactory.Create ()->GetObject ();
+ return Install (node, channel);
+}
+
+NetDeviceContainer
+CsmaHelper::Install (Ptr node, Ptr channel) const
+{
+ return NetDeviceContainer (InstallPriv (node, channel));
+}
+
+NetDeviceContainer
+CsmaHelper::Install (const NodeContainer &c) const
+{
+ Ptr channel = m_channelFactory.Create ()->GetObject ();
+
return Install (c, channel);
}
NetDeviceContainer
-CsmaHelper::Install (const NodeContainer &c, Ptr channel)
+CsmaHelper::Install (const NodeContainer &c, Ptr channel) const
{
- NetDeviceContainer container;
+ NetDeviceContainer devs;
+
for (NodeContainer::Iterator i = c.Begin (); i != c.End (); i++)
{
- Ptr node = *i;
- Ptr device = m_deviceFactory.Create ();
- device->SetAddress (Mac48Address::Allocate ());
- node->AddDevice (device);
- Ptr queue = m_queueFactory.Create ();
- device->SetQueue (queue);
- device->Attach (channel);
- container.Add (device);
+ devs.Add (InstallPriv (*i, channel));
}
- return container;
+
+ return devs;
+}
+
+Ptr
+CsmaHelper::InstallPriv (Ptr node, Ptr channel) const
+{
+ Ptr device = m_deviceFactory.Create ();
+ device->SetAddress (Mac48Address::Allocate ());
+ node->AddDevice (device);
+ Ptr queue = m_queueFactory.Create