merge
authorGustavo J. A. M. Carneiro <gjc@inescporto.pt>
Wed, 16 Jul 2008 14:33:44 +0100
changeset 3459 a67df503c7bc
parent 3458 f289e2045bfc (diff)
parent 3428 75f74d6b6219 (current diff)
child 3460 99698bc858e8
merge
--- a/bindings/python/callbacks_list.py	Wed Jul 16 10:46:51 2008 +0100
+++ b/bindings/python/callbacks_list.py	Wed Jul 16 14:33:44 2008 +0100
@@ -1,12 +1,12 @@
 callback_classes = [
     ['void', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'],
-    ['bool', 'ns3::Ptr<ns3::NetDevice>', 'ns3::Ptr<ns3::Packet>', 'unsigned short', 'ns3::Address const&', 'ns3::empty', 'ns3::empty'],
     ['void', 'ns3::Ptr<ns3::Socket>', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'],
     ['void', 'ns3::Ptr<ns3::Socket>', 'unsigned int', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'],
     ['void', 'ns3::Ptr<ns3::Socket>', 'ns3::Address const&', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'],
     ['bool', 'ns3::Ptr<ns3::Socket>', 'ns3::Address const&', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'],
     ['void', 'ns3::Ptr<ns3::Packet>', 'ns3::Mac48Address const&', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'],
-    ['void', 'ns3::Ptr<ns3::NetDevice>', 'ns3::Ptr<ns3::Packet>', 'unsigned short', 'ns3::Address const&', 'ns3::empty', 'ns3::empty'],
+    ['bool', 'ns3::Ptr<ns3::NetDevice>', 'ns3::Ptr<ns3::Packet>', 'unsigned short', 'ns3::Address const&', 'ns3::Address const&', 'ns3::NetDevice::PacketType'],
+    ['void', 'ns3::Ptr<ns3::NetDevice>', 'ns3::Ptr<ns3::Packet>', 'unsigned short', 'ns3::Address const&', 'ns3::Address const&', 'ns3::NetDevice::PacketType'],
     ['void', 'ns3::Ptr<ns3::Packet>', 'double', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'],
     ['void', 'ns3::Ptr<ns3::Packet>', 'double', 'ns3::WifiMode', 'ns3::WifiPreamble', 'ns3::empty', 'ns3::empty'],
 ]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bindings/python/ns3_module_bridge.py	Wed Jul 16 14:33:44 2008 +0100
@@ -0,0 +1,153 @@
+from pybindgen import Module, FileCodeSink, write_preamble, param, retval
+
+def register_types(module):
+    root_module = module.get_root()
+    
+    ## bridge-net-device.h: ns3::BridgeNetDevice [class]
+    module.add_class('BridgeNetDevice', parent=root_module['ns3::NetDevice'])
+    ## bridge-channel.h: ns3::BridgeChannel [class]
+    module.add_class('BridgeChannel', parent=root_module['ns3::Channel'])
+    
+    ## 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 olsr
+    
+    nested_module = module.add_cpp_namespace('olsr')
+    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()
+    
+
+def register_types_ns3_olsr(module):
+    root_module = module.get_root()
+    
+
+def register_methods(root_module):
+    register_Ns3BridgeNetDevice_methods(root_module, root_module['ns3::BridgeNetDevice'])
+    register_Ns3BridgeChannel_methods(root_module, root_module['ns3::BridgeChannel'])
+    return
+
+def register_Ns3BridgeNetDevice_methods(root_module, cls):
+    ## bridge-net-device.h: static ns3::TypeId ns3::BridgeNetDevice::GetTypeId() [member function]
+    cls.add_method('GetTypeId', 'ns3::TypeId', [], is_static=True)
+    ## bridge-net-device.h: ns3::BridgeNetDevice::BridgeNetDevice() [constructor]
+    cls.add_constructor([], visibility='public')
+    ## bridge-net-device.h: void ns3::BridgeNetDevice::AddBridgePort(ns3::Ptr<ns3::NetDevice> bridgePort) [member function]
+    cls.add_method('AddBridgePort', 'void', [param('ns3::Ptr< ns3::NetDevice >', 'bridgePort')])
+    ## bridge-net-device.h: void ns3::BridgeNetDevice::SetName(std::string const name) [member function]
+    cls.add_method('SetName', 'void', [param('std::string', 'name', is_const=True)], is_virtual=True)
+    ## bridge-net-device.h: std::string ns3::BridgeNetDevice::GetName() const [member function]
+    cls.add_method('GetName', 'std::string', [], is_const=True, is_virtual=True)
+    ## bridge-net-device.h: void ns3::BridgeNetDevice::SetIfIndex(uint32_t const index) [member function]
+    cls.add_method('SetIfIndex', 'void', [param('uint32_t', 'index', is_const=True)], is_virtual=True)
+    ## bridge-net-device.h: uint32_t ns3::BridgeNetDevice::GetIfIndex() const [member function]
+    cls.add_method('GetIfIndex', 'uint32_t', [], is_const=True, is_virtual=True)
+    ## bridge-net-device.h: ns3::Ptr<ns3::Channel> ns3::BridgeNetDevice::GetChannel() const [member function]
+    cls.add_method('GetChannel', 'ns3::Ptr< ns3::Channel >', [], is_const=True, is_virtual=True)
+    ## bridge-net-device.h: ns3::Address ns3::BridgeNetDevice::GetAddress() const [member function]
+    cls.add_method('GetAddress', 'ns3::Address', [], is_const=True, is_virtual=True)
+    ## bridge-net-device.h: bool ns3::BridgeNetDevice::SetMtu(uint16_t const mtu) [member function]
+    cls.add_method('SetMtu', 'bool', [param('uint16_t', 'mtu', is_const=True)], is_virtual=True)
+    ## bridge-net-device.h: uint16_t ns3::BridgeNetDevice::GetMtu() const [member function]
+    cls.add_method('GetMtu', 'uint16_t', [], is_const=True, is_virtual=True)
+    ## bridge-net-device.h: bool ns3::BridgeNetDevice::IsLinkUp() const [member function]
+    cls.add_method('IsLinkUp', 'bool', [], is_const=True, is_virtual=True)
+    ## bridge-net-device.h: void ns3::BridgeNetDevice::SetLinkChangeCallback(ns3::Callback<void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> callback) [member function]
+    cls.add_method('SetLinkChangeCallback', 'void', [param('ns3::Callback< void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'callback')], is_virtual=True)
+    ## bridge-net-device.h: bool ns3::BridgeNetDevice::IsBroadcast() const [member function]
+    cls.add_method('IsBroadcast', 'bool', [], is_const=True, is_virtual=True)
+    ## bridge-net-device.h: ns3::Address ns3::BridgeNetDevice::GetBroadcast() const [member function]
+    cls.add_method('GetBroadcast', 'ns3::Address', [], is_const=True, is_virtual=True)
+    ## bridge-net-device.h: bool ns3::BridgeNetDevice::IsMulticast() const [member function]
+    cls.add_method('IsMulticast', 'bool', [], is_const=True, is_virtual=True)
+    ## bridge-net-device.h: ns3::Address ns3::BridgeNetDevice::GetMulticast() 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)
+    ## bridge-net-device.h: bool ns3::BridgeNetDevice::IsPointToPoint() const [member function]
+    cls.add_method('IsPointToPoint', 'bool', [], is_const=True, is_virtual=True)
+    ## bridge-net-device.h: bool ns3::BridgeNetDevice::Send(ns3::Ptr<ns3::Packet> packet, ns3::Address const & dest, uint16_t protocolNumber) [member function]
+    cls.add_method('Send', 'bool', [param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Address&', 'dest', is_const=True), param('uint16_t', 'protocolNumber')], is_virtual=True)
+    ## bridge-net-device.h: bool ns3::BridgeNetDevice::SendFrom(ns3::Ptr<ns3::Packet> packet, ns3::Address const & source, ns3::Address const & dest, uint16_t protocolNumber) [member function]
+    cls.add_method('SendFrom', 'bool', [param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Address&', 'source', is_const=True), param('ns3::Address&', 'dest', is_const=True), param('uint16_t', 'protocolNumber')], is_virtual=True)
+    ## bridge-net-device.h: ns3::Ptr<ns3::Node> ns3::BridgeNetDevice::GetNode() const [member function]
+    cls.add_method('GetNode', 'ns3::Ptr< ns3::Node >', [], is_const=True, is_virtual=True)
+    ## bridge-net-device.h: void ns3::BridgeNetDevice::SetNode(ns3::Ptr<ns3::Node> node) [member function]
+    cls.add_method('SetNode', 'void', [param('ns3::Ptr< ns3::Node >', 'node')], is_virtual=True)
+    ## bridge-net-device.h: bool ns3::BridgeNetDevice::NeedsArp() const [member function]
+    cls.add_method('NeedsArp', 'bool', [], is_const=True, is_virtual=True)
+    ## bridge-net-device.h: void ns3::BridgeNetDevice::SetReceiveCallback(ns3::Callback<bool, ns3::Ptr<ns3::NetDevice>, ns3::Ptr<ns3::Packet>, unsigned short, ns3::Address const&, ns3::Address const&, ns3::NetDevice::PacketType> cb) [member function]
+    cls.add_method('SetReceiveCallback', 'void', [param('ns3::Callback< bool, ns3::Ptr< ns3::NetDevice >, ns3::Ptr< ns3::Packet >, unsigned short, ns3::Address const&, ns3::Address const&, ns3::NetDevice::PacketType >', 'cb')], is_virtual=True)
+    ## bridge-net-device.h: void ns3::BridgeNetDevice::DoDispose() [member function]
+    cls.add_method('DoDispose', 'void', [], visibility='protected', is_virtual=True)
+    ## bridge-net-device.h: void ns3::BridgeNetDevice::ReceiveFromDevice(ns3::Ptr<ns3::NetDevice> device, ns3::Ptr<ns3::Packet> packet, uint16_t protocol, ns3::Address const & source, ns3::Address const & destination, ns3::NetDevice::PacketType packetType) [member function]
+    cls.add_method('ReceiveFromDevice', 'void', [param('ns3::Ptr< ns3::NetDevice >', 'device'), param('ns3::Ptr< ns3::Packet >', 'packet'), param('uint16_t', 'protocol'), param('ns3::Address&', 'source', is_const=True), param('ns3::Address&', 'destination', is_const=True), param('ns3::NetDevice::PacketType', 'packetType')], visibility='protected')
+    ## bridge-net-device.h: void ns3::BridgeNetDevice::ForwardUnicast(ns3::Ptr<ns3::NetDevice> incomingPort, ns3::Ptr<ns3::Packet> packet, uint16_t protocol, ns3::Mac48Address src, ns3::Mac48Address dst) [member function]
+    cls.add_method('ForwardUnicast', 'void', [param('ns3::Ptr< ns3::NetDevice >', 'incomingPort'), param('ns3::Ptr< ns3::Packet >', 'packet'), param('uint16_t', 'protocol'), param('ns3::Mac48Address', 'src'), param('ns3::Mac48Address', 'dst')], visibility='protected')
+    ## bridge-net-device.h: void ns3::BridgeNetDevice::ForwardBroadcast(ns3::Ptr<ns3::NetDevice> incomingPort, ns3::Ptr<ns3::Packet> packet, uint16_t protocol, ns3::Mac48Address src, ns3::Mac48Address dst) [member function]
+    cls.add_method('ForwardBroadcast', 'void', [param('ns3::Ptr< ns3::NetDevice >', 'incomingPort'), param('ns3::Ptr< ns3::Packet >', 'packet'), param('uint16_t', 'protocol'), param('ns3::Mac48Address', 'src'), param('ns3::Mac48Address', 'dst')], visibility='protected')
+    ## bridge-net-device.h: void ns3::BridgeNetDevice::Learn(ns3::Mac48Address source, ns3::Ptr<ns3::NetDevice> port) [member function]
+    cls.add_method('Learn', 'void', [param('ns3::Mac48Address', 'source'), param('ns3::Ptr< ns3::NetDevice >', 'port')], visibility='protected')
+    ## bridge-net-device.h: ns3::Ptr<ns3::NetDevice> ns3::BridgeNetDevice::GetLearnedState(ns3::Mac48Address source) [member function]
+    cls.add_method('GetLearnedState', 'ns3::Ptr< ns3::NetDevice >', [param('ns3::Mac48Address', 'source')], visibility='protected')
+    return
+
+def register_Ns3BridgeChannel_methods(root_module, cls):
+    ## bridge-channel.h: static ns3::TypeId ns3::BridgeChannel::GetTypeId() [member function]
+    cls.add_method('GetTypeId', 'ns3::TypeId', [], is_static=True)
+    ## bridge-channel.h: ns3::BridgeChannel::BridgeChannel() [constructor]
+    cls.add_constructor([], visibility='public')
+    ## bridge-channel.h: void ns3::BridgeChannel::AddChannel(ns3::Ptr<ns3::Channel> bridgedChannel) [member function]
+    cls.add_method('AddChannel', 'void', [param('ns3::Ptr< ns3::Channel >', 'bridgedChannel')])
+    ## bridge-channel.h: uint32_t ns3::BridgeChannel::GetNDevices() const [member function]
+    cls.add_method('GetNDevices', 'uint32_t', [], is_const=True, is_virtual=True)
+    ## bridge-channel.h: ns3::Ptr<ns3::NetDevice> ns3::BridgeChannel::GetDevice(uint32_t i) const [member function]
+    cls.add_method('GetDevice', 'ns3::Ptr< ns3::NetDevice >', [param('uint32_t', 'i')], is_const=True, is_virtual=True)
+    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_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_olsr(module, root_module):
+    return
+
--- a/bindings/python/ns3_module_common.py	Wed Jul 16 10:46:51 2008 +0100
+++ b/bindings/python/ns3_module_common.py	Wed Jul 16 14:33:44 2008 +0100
@@ -24,27 +24,27 @@
     ## buffer.h: ns3::Buffer::Iterator [class]
     module.add_class('Iterator', outer_class=root_module['ns3::Buffer'])
     ## chunk.h: ns3::Chunk [class]
-    module.add_class('Chunk', allow_subclassing=True, parent=root_module['ns3::ObjectBase'])
+    module.add_class('Chunk', parent=root_module['ns3::ObjectBase'])
     ## data-rate.h: ns3::DataRate [class]
     module.add_class('DataRate')
     ## tag.h: ns3::Tag [class]
-    module.add_class('Tag', allow_subclassing=True, parent=root_module['ns3::ObjectBase'])
+    module.add_class('Tag', parent=root_module['ns3::ObjectBase'])
     ## pcap-writer.h: ns3::PcapWriter [class]
     module.add_class('PcapWriter', parent=root_module['ns3::RefCountBase'])
     ## data-rate.h: ns3::DataRateChecker [class]
     module.add_class('DataRateChecker', parent=root_module['ns3::AttributeChecker'])
     ## error-model.h: ns3::ErrorModel [class]
-    module.add_class('ErrorModel', allow_subclassing=True, parent=root_module['ns3::Object'])
+    module.add_class('ErrorModel', parent=root_module['ns3::Object'])
     ## header.h: ns3::Header [class]
-    module.add_class('Header', allow_subclassing=True, parent=root_module['ns3::Chunk'])
+    module.add_class('Header', parent=root_module['ns3::Chunk'])
     ## trailer.h: ns3::Trailer [class]
-    module.add_class('Trailer', allow_subclassing=True, parent=root_module['ns3::Chunk'])
+    module.add_class('Trailer', parent=root_module['ns3::Chunk'])
     ## error-model.h: ns3::ListErrorModel [class]
-    module.add_class('ListErrorModel', allow_subclassing=True, parent=root_module['ns3::ErrorModel'])
+    module.add_class('ListErrorModel', parent=root_module['ns3::ErrorModel'])
     ## data-rate.h: ns3::DataRateValue [class]
-    module.add_class('DataRateValue', allow_subclassing=True, parent=root_module['ns3::AttributeValue'])
+    module.add_class('DataRateValue', parent=root_module['ns3::AttributeValue'])
     ## error-model.h: ns3::RateErrorModel [class]
-    module.add_class('RateErrorModel', allow_subclassing=True, parent=root_module['ns3::ErrorModel'])
+    module.add_class('RateErrorModel', parent=root_module['ns3::ErrorModel'])
     
     ## Register a nested module for the namespace internal
     
--- a/bindings/python/ns3_module_contrib.py	Wed Jul 16 10:46:51 2008 +0100
+++ b/bindings/python/ns3_module_contrib.py	Wed Jul 16 14:33:44 2008 +0100
@@ -16,7 +16,7 @@
     ## gtk-config-store.h: ns3::GtkConfigStore [class]
     module.add_class('GtkConfigStore')
     ## config-store.h: ns3::ConfigStore [class]
-    module.add_class('ConfigStore', allow_subclassing=True, parent=root_module['ns3::ObjectBase'])
+    module.add_class('ConfigStore', parent=root_module['ns3::ObjectBase'])
     ## delay-jitter-estimation.h: ns3::DelayJitterEstimation [class]
     module.add_class('DelayJitterEstimation')
     
--- a/bindings/python/ns3_module_core.py	Wed Jul 16 10:46:51 2008 +0100
+++ b/bindings/python/ns3_module_core.py	Wed Jul 16 14:33:44 2008 +0100
@@ -32,7 +32,7 @@
     ## object-factory.h: ns3::ObjectFactory [class]
     module.add_class('ObjectFactory')
     ## attribute.h: ns3::AttributeAccessor [class]
-    module.add_class('AttributeAccessor', allow_subclassing=True, parent=root_module['ns3::RefCountBase'])
+    module.add_class('AttributeAccessor', parent=root_module['ns3::RefCountBase'])
     ## random-variable.h: ns3::ParetoVariable [class]
     module.add_class('ParetoVariable', parent=root_module['ns3::RandomVariable'])
     ## random-variable.h: ns3::ConstantVariable [class]
@@ -40,7 +40,7 @@
     ## random-variable.h: ns3::EmpiricalVariable [class]
     module.add_class('EmpiricalVariable', parent=root_module['ns3::RandomVariable'])
     ## enum.h: ns3::EnumChecker [class]
-    module.add_class('EnumChecker', allow_subclassing=True, parent=root_module['ns3::AttributeChecker'])
+    module.add_class('EnumChecker', parent=root_module['ns3::AttributeChecker'])
     ## empty.h: ns3::empty [class]
     module.add_class('empty')
     ## object-base.h: ns3::ObjectBase [class]
@@ -82,7 +82,7 @@
     ## random-variable.h: ns3::IntEmpiricalVariable [class]
     module.add_class('IntEmpiricalVariable', parent=root_module['ns3::EmpiricalVariable'])
     ## pointer.h: ns3::PointerChecker [class]
-    module.add_class('PointerChecker', allow_subclassing=True, parent=root_module['ns3::AttributeChecker'])
+    module.add_class('PointerChecker', parent=root_module['ns3::AttributeChecker'])
     ## random-variable.h: ns3::WeibullVariable [class]
     module.add_class('WeibullVariable', parent=root_module['ns3::RandomVariable'])
     ## callback.h: ns3::CallbackBase [class]
@@ -118,47 +118,47 @@
     ## random-variable.h: ns3::UniformVariable [class]
     module.add_class('UniformVariable', parent=root_module['ns3::RandomVariable'])
     ## object.h: ns3::Object [class]
-    module.add_class('Object', peekref_method='GetReferenceCount', parent=root_module['ns3::ObjectBase'], incref_method='Ref', decref_method='Unref', allow_subclassing=True, automatic_type_narrowing=True)
+    module.add_class('Object', incref_method='Ref', automatic_type_narrowing=True, decref_method='Unref', parent=root_module['ns3::ObjectBase'], peekref_method='GetReferenceCount')
     ## object.h: ns3::Object::AggregateIterator [class]
     module.add_class('AggregateIterator', outer_class=root_module['ns3::Object'])
     ## random-variable.h: ns3::SequentialVariable [class]
     module.add_class('SequentialVariable', parent=root_module['ns3::RandomVariable'])
     ## object-vector.h: ns3::ObjectVectorChecker [class]
-    module.add_class('ObjectVectorChecker', allow_subclassing=True, parent=root_module['ns3::AttributeChecker'])
+    module.add_class('ObjectVectorChecker', parent=root_module['ns3::AttributeChecker'])
     ## string.h: ns3::StringChecker [class]
     module.add_class('StringChecker', parent=root_module['ns3::AttributeChecker'])
     ## object-vector.h: ns3::ObjectVectorValue [class]
-    module.add_class('ObjectVectorValue', allow_subclassing=True, parent=root_module['ns3::AttributeValue'])
+    module.add_class('ObjectVectorValue', parent=root_module['ns3::AttributeValue'])
     ## boolean.h: ns3::BooleanChecker [class]
     module.add_class('BooleanChecker', parent=root_module['ns3::AttributeChecker'])
     ## uinteger.h: ns3::UintegerValue [class]
-    module.add_class('UintegerValue', allow_subclassing=True, parent=root_module['ns3::AttributeValue'])
+    module.add_class('UintegerValue', parent=root_module['ns3::AttributeValue'])
     ## object-vector.h: ns3::ObjectVectorAccessor [class]
-    module.add_class('ObjectVectorAccessor', allow_subclassing=True, parent=root_module['ns3::AttributeAccessor'])
+    module.add_class('ObjectVectorAccessor', parent=root_module['ns3::AttributeAccessor'])
     ## pointer.h: ns3::PointerValue [class]
-    module.add_class('PointerValue', allow_subclassing=True, parent=root_module['ns3::AttributeValue'])
+    module.add_class('PointerValue', parent=root_module['ns3::AttributeValue'])
     ## object-factory.h: ns3::ObjectFactoryChecker [class]
     module.add_class('ObjectFactoryChecker', parent=root_module['ns3::AttributeChecker'])
     ## type-id.h: ns3::TypeIdChecker [class]
     module.add_class('TypeIdChecker', parent=root_module['ns3::AttributeChecker'])
     ## double.h: ns3::DoubleValue [class]
-    module.add_class('DoubleValue', allow_subclassing=True, parent=root_module['ns3::AttributeValue'])
-    ## string.h: ns3::StringValue [class]
-    module.add_class('StringValue', allow_subclassing=True, parent=root_module['ns3::AttributeValue'])
+    module.add_class('DoubleValue', parent=root_module['ns3::AttributeValue'])
     ## type-id.h: ns3::TypeIdValue [class]
-    module.add_class('TypeIdValue', allow_subclassing=True, parent=root_module['ns3::AttributeValue'])
+    module.add_class('TypeIdValue', parent=root_module['ns3::AttributeValue'])
     ## enum.h: ns3::EnumValue [class]
-    module.add_class('EnumValue', allow_subclassing=True, parent=root_module['ns3::AttributeValue'])
+    module.add_class('EnumValue', parent=root_module['ns3::AttributeValue'])
     ## random-variable.h: ns3::RandomVariableValue [class]
-    module.add_class('RandomVariableValue', allow_subclassing=True, parent=root_module['ns3::AttributeValue'])
+    module.add_class('RandomVariableValue', parent=root_module['ns3::AttributeValue'])
     ## object-factory.h: ns3::ObjectFactoryValue [class]
-    module.add_class('ObjectFactoryValue', allow_subclassing=True, parent=root_module['ns3::AttributeValue'])
+    module.add_class('ObjectFactoryValue', parent=root_module['ns3::AttributeValue'])
     ## integer.h: ns3::IntegerValue [class]
-    module.add_class('IntegerValue', allow_subclassing=True, parent=root_module['ns3::AttributeValue'])
+    module.add_class('IntegerValue', parent=root_module['ns3::AttributeValue'])
+    ## boolean.h: ns3::BooleanValue [class]
+    module.add_class('BooleanValue', parent=root_module['ns3::AttributeValue'])
+    ## string.h: ns3::StringValue [class]
+    module.add_class('StringValue', parent=root_module['ns3::AttributeValue'])
     ## attribute.h: ns3::EmptyAttributeValue [class]
-    module.add_class('EmptyAttributeValue', allow_subclassing=True, parent=root_module['ns3::AttributeValue'])
-    ## boolean.h: ns3::BooleanValue [class]
-    module.add_class('BooleanValue', allow_subclassing=True, parent=root_module['ns3::AttributeValue'])
+    module.add_class('EmptyAttributeValue', parent=root_module['ns3::AttributeValue'])
     ## traced-value.h: ns3::TracedValue<unsigned int> [class]
     module.add_class('TracedValue', template_parameters=['unsigned int'])
     ## traced-value.h: ns3::TracedValue<unsigned int> [class]
@@ -273,14 +273,14 @@
     register_Ns3ObjectFactoryChecker_methods(root_module, root_module['ns3::ObjectFactoryChecker'])
     register_Ns3TypeIdChecker_methods(root_module, root_module['ns3::TypeIdChecker'])
     register_Ns3DoubleValue_methods(root_module, root_module['ns3::DoubleValue'])
-    register_Ns3StringValue_methods(root_module, root_module['ns3::StringValue'])
     register_Ns3TypeIdValue_methods(root_module, root_module['ns3::TypeIdValue'])
     register_Ns3EnumValue_methods(root_module, root_module['ns3::EnumValue'])
     register_Ns3RandomVariableValue_methods(root_module, root_module['ns3::RandomVariableValue'])
     register_Ns3ObjectFactoryValue_methods(root_module, root_module['ns3::ObjectFactoryValue'])
     register_Ns3IntegerValue_methods(root_module, root_module['ns3::IntegerValue'])
+    register_Ns3BooleanValue_methods(root_module, root_module['ns3::BooleanValue'])
+    register_Ns3StringValue_methods(root_module, root_module['ns3::StringValue'])
     register_Ns3EmptyAttributeValue_methods(root_module, root_module['ns3::EmptyAttributeValue'])
-    register_Ns3BooleanValue_methods(root_module, root_module['ns3::BooleanValue'])
     register_Ns3TracedValue__Unsigned_int_methods(root_module, root_module['ns3::TracedValue< unsigned int >'])
     return
 
@@ -1061,23 +1061,6 @@
     cls.add_method('DeserializeFromString', 'bool', [param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], is_virtual=True)
     return
 
-def register_Ns3StringValue_methods(root_module, cls):
-    ## string.h: ns3::StringValue::StringValue() [constructor]
-    cls.add_constructor([], visibility='public')
-    ## string.h: ns3::StringValue::StringValue(std::string const & value) [constructor]
-    cls.add_constructor([param('std::string&', 'value', is_const=True)], visibility='public')
-    ## string.h: void ns3::StringValue::Set(std::string const & value) [member function]
-    cls.add_method('Set', 'void', [param('std::string&', 'value', is_const=True)])
-    ## string.h: std::string ns3::StringValue::Get() const [member function]
-    cls.add_method('Get', 'std::string', [], is_const=True)
-    ## string.h: ns3::Ptr<ns3::AttributeValue> ns3::StringValue::Copy() const [member function]
-    cls.add_method('Copy', 'ns3::Ptr< ns3::AttributeValue >', [], is_const=True, is_virtual=True)
-    ## string.h: std::string ns3::StringValue::SerializeToString(ns3::Ptr<ns3::AttributeChecker const> checker) const [member function]
-    cls.add_method('SerializeToString', 'std::string', [param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], is_const=True, is_virtual=True)
-    ## string.h: bool ns3::StringValue::DeserializeFromString(std::string value, ns3::Ptr<ns3::AttributeChecker const> 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_Ns3TypeIdValue_methods(root_module, cls):
     ## type-id.h: ns3::TypeIdValue::TypeIdValue() [constructor]
     cls.add_constructor([], visibility='public')
@@ -1163,19 +1146,6 @@
     cls.add_method('DeserializeFromString', 'bool', [param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], is_virtual=True)
     return
 
-def register_Ns3EmptyAttributeValue_methods(root_module, cls):
-    ## attribute.h: ns3::EmptyAttributeValue::EmptyAttributeValue(ns3::EmptyAttributeValue const & arg0) [copy constructor]
-    cls.add_constructor([param('ns3::EmptyAttributeValue&', 'arg0', is_const=True)], visibility='public')
-    ## attribute.h: ns3::EmptyAttributeValue::EmptyAttributeValue() [constructor]
-    cls.add_constructor([], visibility='public')
-    ## attribute.h: ns3::Ptr<ns3::AttributeValue> ns3::EmptyAttributeValue::Copy() const [member function]
-    cls.add_method('Copy', 'ns3::Ptr< ns3::AttributeValue >', [], is_const=True, visibility='private', is_virtual=True)
-    ## attribute.h: std::string ns3::EmptyAttributeValue::SerializeToString(ns3::Ptr<ns3::AttributeChecker const> checker) const [member function]
-    cls.add_method('SerializeToString', 'std::string', [param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], is_const=True, visibility='private', is_virtual=True)
-    ## attribute.h: bool ns3::EmptyAttributeValue::DeserializeFromString(std::string value, ns3::Ptr<ns3::AttributeChecker const> checker) [member function]
-    cls.add_method('DeserializeFromString', 'bool', [param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], visibility='private', is_virtual=True)
-    return
-
 def register_Ns3BooleanValue_methods(root_module, cls):
     ## boolean.h: ns3::BooleanValue::BooleanValue(ns3::BooleanValue const & arg0) [copy constructor]
     cls.add_constructor([param('ns3::BooleanValue&', 'arg0', is_const=True)], visibility='public')
@@ -1196,6 +1166,36 @@
     cls.add_output_stream_operator()
     return
 
+def register_Ns3StringValue_methods(root_module, cls):
+    ## string.h: ns3::StringValue::StringValue() [constructor]
+    cls.add_constructor([], visibility='public')
+    ## string.h: ns3::StringValue::StringValue(std::string const & value) [constructor]
+    cls.add_constructor([param('std::string&', 'value', is_const=True)], visibility='public')
+    ## string.h: void ns3::StringValue::Set(std::string const & value) [member function]
+    cls.add_method('Set', 'void', [param('std::string&', 'value', is_const=True)])
+    ## string.h: std::string ns3::StringValue::Get() const [member function]
+    cls.add_method('Get', 'std::string', [], is_const=True)
+    ## string.h: ns3::Ptr<ns3::AttributeValue> ns3::StringValue::Copy() const [member function]
+    cls.add_method('Copy', 'ns3::Ptr< ns3::AttributeValue >', [], is_const=True, is_virtual=True)
+    ## string.h: std::string ns3::StringValue::SerializeToString(ns3::Ptr<ns3::AttributeChecker const> checker) const [member function]
+    cls.add_method('SerializeToString', 'std::string', [param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], is_const=True, is_virtual=True)
+    ## string.h: bool ns3::StringValue::DeserializeFromString(std::string value, ns3::Ptr<ns3::AttributeChecker const> 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_Ns3EmptyAttributeValue_methods(root_module, cls):
+    ## attribute.h: ns3::EmptyAttributeValue::EmptyAttributeValue(ns3::EmptyAttributeValue const & arg0) [copy constructor]
+    cls.add_constructor([param('ns3::EmptyAttributeValue&', 'arg0', is_const=True)], visibility='public')
+    ## attribute.h: ns3::EmptyAttributeValue::EmptyAttributeValue() [constructor]
+    cls.add_constructor([], visibility='public')
+    ## attribute.h: ns3::Ptr<ns3::AttributeValue> ns3::EmptyAttributeValue::Copy() const [member function]
+    cls.add_method('Copy', 'ns3::Ptr< ns3::AttributeValue >', [], is_const=True, visibility='private', is_virtual=True)
+    ## attribute.h: std::string ns3::EmptyAttributeValue::SerializeToString(ns3::Ptr<ns3::AttributeChecker const> checker) const [member function]
+    cls.add_method('SerializeToString', 'std::string', [param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], is_const=True, visibility='private', is_virtual=True)
+    ## attribute.h: bool ns3::EmptyAttributeValue::DeserializeFromString(std::string value, ns3::Ptr<ns3::AttributeChecker const> checker) [member function]
+    cls.add_method('DeserializeFromString', 'bool', [param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], visibility='private', is_virtual=True)
+    return
+
 def register_Ns3TracedValue__Unsigned_int_methods(root_module, cls):
     ## traced-value.h: ns3::TracedValue<unsigned int>::TracedValue() [constructor]
     cls.add_constructor([], visibility='public')
--- a/bindings/python/ns3_module_csma.py	Wed Jul 16 10:46:51 2008 +0100
+++ b/bindings/python/ns3_module_csma.py	Wed Jul 16 14:33:44 2008 +0100
@@ -10,9 +10,9 @@
     ## backoff.h: ns3::Backoff [class]
     module.add_class('Backoff')
     ## csma-channel.h: ns3::CsmaChannel [class]
-    module.add_class('CsmaChannel', allow_subclassing=True, parent=root_module['ns3::Channel'])
+    module.add_class('CsmaChannel', parent=root_module['ns3::Channel'])
     ## csma-net-device.h: ns3::CsmaNetDevice [class]
-    module.add_class('CsmaNetDevice', allow_subclassing=True, parent=root_module['ns3::NetDevice'])
+    module.add_class('CsmaNetDevice', parent=root_module['ns3::NetDevice'])
     ## csma-net-device.h: ns3::CsmaNetDevice::CsmaEncapsulationMode [enumeration]
     module.add_enum('CsmaEncapsulationMode', ['ETHERNET_V1', 'IP_ARP', 'RAW', 'LLC'], outer_class=root_module['ns3::CsmaNetDevice'])
     
@@ -159,8 +159,8 @@
     cls.add_method('SetQueue', 'void', [param('ns3::Ptr< ns3::Queue >', 'queue')])
     ## csma-net-device.h: void ns3::CsmaNetDevice::SetReceiveErrorModel(ns3::Ptr<ns3::ErrorModel> em) [member function]
     cls.add_method('SetReceiveErrorModel', 'void', [param('ns3::Ptr< ns3::ErrorModel >', 'em')])
-    ## csma-net-device.h: void ns3::CsmaNetDevice::Receive(ns3::Ptr<ns3::Packet> p) [member function]
-    cls.add_method('Receive', 'void', [param('ns3::Ptr< ns3::Packet >', 'p')])
+    ## csma-net-device.h: void ns3::CsmaNetDevice::Receive(ns3::Ptr<ns3::Packet> p, ns3::Ptr<ns3::CsmaNetDevice> sender) [member function]
+    cls.add_method('Receive', 'void', [param('ns3::Ptr< ns3::Packet >', 'p'), param('ns3::Ptr< ns3::CsmaNetDevice >', 'sender')])
     ## csma-net-device.h: bool ns3::CsmaNetDevice::IsSendEnabled() [member function]
     cls.add_method('IsSendEnabled', 'bool', [])
     ## csma-net-device.h: void ns3::CsmaNetDevice::SetSendEnable(bool enable) [member function]
@@ -205,20 +205,22 @@
     cls.add_method('IsPointToPoint', 'bool', [], is_const=True, is_virtual=True)
     ## csma-net-device.h: bool ns3::CsmaNetDevice::Send(ns3::Ptr<ns3::Packet> packet, ns3::Address const & dest, uint16_t protocolNumber) [member function]
     cls.add_method('Send', 'bool', [param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Address&', 'dest', is_const=True), param('uint16_t', 'protocolNumber')], is_virtual=True)
+    ## csma-net-device.h: bool ns3::CsmaNetDevice::SendFrom(ns3::Ptr<ns3::Packet> packet, ns3::Address const & source, ns3::Address const & dest, uint16_t protocolNumber) [member function]
+    cls.add_method('SendFrom', 'bool', [param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Address&', 'source', is_const=True), param('ns3::Address&', 'dest', is_const=True), param('uint16_t', 'protocolNumber')], is_virtual=True)
     ## csma-net-device.h: ns3::Ptr<ns3::Node> ns3::CsmaNetDevice::GetNode() const [member function]
     cls.add_method('GetNode', 'ns3::Ptr< ns3::Node >', [], is_const=True, is_virtual=True)
     ## csma-net-device.h: void ns3::CsmaNetDevice::SetNode(ns3::Ptr<ns3::Node> node) [member function]
     cls.add_method('SetNode', 'void', [param('ns3::Ptr< ns3::Node >', 'node')], is_virtual=True)
     ## csma-net-device.h: bool ns3::CsmaNetDevice::NeedsArp() const [member function]
     cls.add_method('NeedsArp', 'bool', [], is_const=True, is_virtual=True)
-    ## csma-net-device.h: void ns3::CsmaNetDevice::SetReceiveCallback(ns3::Callback<bool, ns3::Ptr<ns3::NetDevice>, ns3::Ptr<ns3::Packet>, 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 >, unsigned short, ns3::Address const&, ns3::empty, ns3::empty >', 'cb')], is_virtual=True)
+    ## csma-net-device.h: void ns3::CsmaNetDevice::SetReceiveCallback(ns3::Callback<bool, ns3::Ptr<ns3::NetDevice>, ns3::Ptr<ns3::Packet>, unsigned short, ns3::Address const&, ns3::Address const&, ns3::NetDevice::PacketType> cb) [member function]
+    cls.add_method('SetReceiveCallback', 'void', [param('ns3::Callback< bool, ns3::Ptr< ns3::NetDevice >, ns3::Ptr< ns3::Packet >, unsigned short, ns3::Address const&, ns3::Address const&, ns3::NetDevice::PacketType >', 'cb')], is_virtual=True)
     ## csma-net-device.h: void ns3::CsmaNetDevice::DoDispose() [member function]
     cls.add_method('DoDispose', 'void', [], visibility='protected', is_virtual=True)
     ## csma-net-device.h: ns3::Ptr<ns3::Queue> ns3::CsmaNetDevice::GetQueue() const [member function]
     cls.add_method('GetQueue', 'ns3::Ptr< ns3::Queue >', [], is_const=True, visibility='protected')
-    ## csma-net-device.h: void ns3::CsmaNetDevice::AddHeader(ns3::Ptr<ns3::Packet> p, ns3::Mac48Address dest, uint16_t protocolNumber) [member function]
-    cls.add_method('AddHeader', 'void', [param('ns3::Ptr< ns3::Packet >', 'p'), param('ns3::Mac48Address', 'dest'), param('uint16_t', 'protocolNumber')], visibility='protected')
+    ## csma-net-device.h: void ns3::CsmaNetDevice::AddHeader(ns3::Ptr<ns3::Packet> p, ns3::Mac48Address source, ns3::Mac48Address dest, uint16_t protocolNumber) [member function]
+    cls.add_method('AddHeader', 'void', [param('ns3::Ptr< ns3::Packet >', 'p'), param('ns3::Mac48Address', 'source'), param('ns3::Mac48Address', 'dest'), param('uint16_t', 'protocolNumber')], visibility='protected')
     ## csma-net-device.h: bool ns3::CsmaNetDevice::ProcessHeader(ns3::Ptr<ns3::Packet> p, uint16_t & param) [member function]
     cls.add_method('ProcessHeader', 'bool', [param('ns3::Ptr< ns3::Packet >', 'p'), param('uint16_t&', 'param')], visibility='protected')
     return
--- a/bindings/python/ns3_module_global_routing.py	Wed Jul 16 10:46:51 2008 +0100
+++ b/bindings/python/ns3_module_global_routing.py	Wed Jul 16 14:33:44 2008 +0100
@@ -16,7 +16,7 @@
     ## global-router-interface.h: ns3::GlobalRoutingLinkRecord::LinkType [enumeration]
     module.add_enum('LinkType', ['Unknown', 'PointToPoint', 'TransitNetwork', 'StubNetwork', 'VirtualLink'], outer_class=root_module['ns3::GlobalRoutingLinkRecord'])
     ## global-router-interface.h: ns3::GlobalRouter [class]
-    module.add_class('GlobalRouter', allow_subclassing=True, is_singleton=True, parent=root_module['ns3::Object'])
+    module.add_class('GlobalRouter', is_singleton=True, parent=root_module['ns3::Object'])
     
     ## Register a nested module for the namespace internal
     
--- a/bindings/python/ns3_module_internet_stack.py	Wed Jul 16 10:46:51 2008 +0100
+++ b/bindings/python/ns3_module_internet_stack.py	Wed Jul 16 14:33:44 2008 +0100
@@ -4,17 +4,17 @@
     root_module = module.get_root()
     
     ## ipv4-interface.h: ns3::Ipv4Interface [class]
-    module.add_class('Ipv4Interface', allow_subclassing=True, parent=root_module['ns3::Object'])
+    module.add_class('Ipv4Interface', parent=root_module['ns3::Object'])
     ## udp-header.h: ns3::UdpHeader [class]
-    module.add_class('UdpHeader', allow_subclassing=True, parent=root_module['ns3::Header'])
+    module.add_class('UdpHeader', parent=root_module['ns3::Header'])
     ## tcp-header.h: ns3::TcpHeader [class]
-    module.add_class('TcpHeader', allow_subclassing=True, parent=root_module['ns3::Header'])
+    module.add_class('TcpHeader', parent=root_module['ns3::Header'])
     ## tcp-header.h: ns3::TcpHeader::Flags_t [enumeration]
     module.add_enum('Flags_t', ['NONE', 'FIN', 'SYN', 'RST', 'PSH', 'ACK', 'URG'], outer_class=root_module['ns3::TcpHeader'])
     ## ipv4-static-routing.h: ns3::Ipv4StaticRouting [class]
-    module.add_class('Ipv4StaticRouting', allow_subclassing=True, parent=root_module['ns3::Ipv4RoutingProtocol'])
+    module.add_class('Ipv4StaticRouting', parent=root_module['ns3::Ipv4RoutingProtocol'])
     ## ipv4-l3-protocol.h: ns3::Ipv4L3Protocol [class]
-    module.add_class('Ipv4L3Protocol', allow_subclassing=True, parent=root_module['ns3::Object'])
+    module.add_class('Ipv4L3Protocol', parent=root_module['ns3::Object'])
     
     ## Register a nested module for the namespace internal
     
@@ -245,8 +245,8 @@
     cls.add_method('SetDefaultTtl', 'void', [param('uint8_t', 'ttl')])
     ## ipv4-l3-protocol.h: ns3::Ptr<ns3::Ipv4Interface> ns3::Ipv4L3Protocol::FindInterfaceForDevice(ns3::Ptr<const ns3::NetDevice> device) [member function]
     cls.add_method('FindInterfaceForDevice', 'ns3::Ptr< ns3::Ipv4Interface >', [param('ns3::Ptr< const ns3::NetDevice >', 'device')])
-    ## ipv4-l3-protocol.h: void ns3::Ipv4L3Protocol::Receive(ns3::Ptr<ns3::NetDevice> device, ns3::Ptr<ns3::Packet> p, uint16_t protocol, ns3::Address const & from) [member function]
-    cls.add_method('Receive', 'void', [param('ns3::Ptr< ns3::NetDevice >', 'device'), param('ns3::Ptr< ns3::Packet >', 'p'), param('uint16_t', 'protocol'), param('ns3::Address&', 'from', is_const=True)])
+    ## ipv4-l3-protocol.h: void ns3::Ipv4L3Protocol::Receive(ns3::Ptr<ns3::NetDevice> device, ns3::Ptr<ns3::Packet> p, uint16_t protocol, ns3::Address const & from, ns3::Address const & to, ns3::NetDevice::PacketType packetType) [member function]
+    cls.add_method('Receive', 'void', [param('ns3::Ptr< ns3::NetDevice >', 'device'), param('ns3::Ptr< ns3::Packet >', 'p'), param('uint16_t', 'protocol'), param('ns3::Address&', 'from', is_const=True), param('ns3::Address&', 'to', is_const=True), param('ns3::NetDevice::PacketType', 'packetType')])
     ## ipv4-l3-protocol.h: void ns3::Ipv4L3Protocol::Send(ns3::Ptr<ns3::Packet> packet, ns3::Ipv4Address source, ns3::Ipv4Address destination, uint8_t protocol) [member function]
     cls.add_method('Send', 'void', [param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Ipv4Address', 'source'), param('ns3::Ipv4Address', 'destination'), param('uint8_t', 'protocol')])
     ## ipv4-l3-protocol.h: void ns3::Ipv4L3Protocol::AddHostRouteTo(ns3::Ipv4Address dest, ns3::Ipv4Address nextHop, uint32_t interface) [member function]
--- a/bindings/python/ns3_module_mobility.py	Wed Jul 16 10:46:51 2008 +0100
+++ b/bindings/python/ns3_module_mobility.py	Wed Jul 16 14:33:44 2008 +0100
@@ -16,37 +16,37 @@
     ## rectangle.h: ns3::Rectangle::Side [enumeration]
     module.add_enum('Side', ['RIGHT', 'LEFT', 'TOP', 'BOTTOM'], outer_class=root_module['ns3::Rectangle'])
     ## position-allocator.h: ns3::PositionAllocator [class]
-    module.add_class('PositionAllocator', allow_subclassing=True, parent=root_module['ns3::Object'])
+    module.add_class('PositionAllocator', parent=root_module['ns3::Object'])
     ## position-allocator.h: ns3::ListPositionAllocator [class]
-    module.add_class('ListPositionAllocator', allow_subclassing=True, parent=root_module['ns3::PositionAllocator'])
+    module.add_class('ListPositionAllocator', parent=root_module['ns3::PositionAllocator'])
     ## rectangle.h: ns3::RectangleValue [class]
-    module.add_class('RectangleValue', allow_subclassing=True, parent=root_module['ns3::AttributeValue'])
+    module.add_class('RectangleValue', parent=root_module['ns3::AttributeValue'])
     ## position-allocator.h: ns3::RandomRectanglePositionAllocator [class]
-    module.add_class('RandomRectanglePositionAllocator', allow_subclassing=True, parent=root_module['ns3::PositionAllocator'])
+    module.add_class('RandomRectanglePositionAllocator', parent=root_module['ns3::PositionAllocator'])
     ## vector.h: ns3::VectorValue [class]
-    module.add_class('VectorValue', allow_subclassing=True, parent=root_module['ns3::AttributeValue'])
+    module.add_class('VectorValue', parent=root_module['ns3::AttributeValue'])
     ## position-allocator.h: ns3::RandomDiscPositionAllocator [class]
-    module.add_class('RandomDiscPositionAllocator', allow_subclassing=True, parent=root_module['ns3::PositionAllocator'])
+    module.add_class('RandomDiscPositionAllocator', parent=root_module['ns3::PositionAllocator'])
     ## mobility-model.h: ns3::MobilityModel [class]
-    module.add_class('MobilityModel', allow_subclassing=True, parent=root_module['ns3::Object'])
+    module.add_class('MobilityModel', parent=root_module['ns3::Object'])
     ## random-direction-2d-mobility-model.h: ns3::RandomDirection2dMobilityModel [class]
-    module.add_class('RandomDirection2dMobilityModel', allow_subclassing=True, parent=root_module['ns3::MobilityModel'])
+    module.add_class('RandomDirection2dMobilityModel', parent=root_module['ns3::MobilityModel'])
     ## position-allocator.h: ns3::GridPositionAllocator [class]
-    module.add_class('GridPositionAllocator', allow_subclassing=True, parent=root_module['ns3::PositionAllocator'])
+    module.add_class('GridPositionAllocator', parent=root_module['ns3::PositionAllocator'])
     ## position-allocator.h: ns3::GridPositionAllocator::LayoutType [enumeration]
     module.add_enum('LayoutType', ['ROW_FIRST', 'COLUMN_FIRST'], outer_class=root_module['ns3::GridPositionAllocator'])
     ## random-waypoint-mobility-model.h: ns3::RandomWaypointMobilityModel [class]
-    module.add_class('RandomWaypointMobilityModel', allow_subclassing=True, parent=root_module['ns3::MobilityModel'])
+    module.add_class('RandomWaypointMobilityModel', parent=root_module['ns3::MobilityModel'])
     ## random-walk-2d-mobility-model.h: ns3::RandomWalk2dMobilityModel [class]
-    module.add_class('RandomWalk2dMobilityModel', allow_subclassing=True, parent=root_module['ns3::MobilityModel'])
+    module.add_class('RandomWalk2dMobilityModel', parent=root_module['ns3::MobilityModel'])
     ## random-walk-2d-mobility-model.h: ns3::RandomWalk2dMobilityModel::Mode [enumeration]
     module.add_enum('Mode', ['MODE_DISTANCE', 'MODE_TIME'], outer_class=root_module['ns3::RandomWalk2dMobilityModel'])
     ## static-speed-mobility-model.h: ns3::StaticSpeedMobilityModel [class]
-    module.add_class('StaticSpeedMobilityModel', allow_subclassing=True, parent=root_module['ns3::MobilityModel'])
+    module.add_class('StaticSpeedMobilityModel', parent=root_module['ns3::MobilityModel'])
     ## hierarchical-mobility-model.h: ns3::HierarchicalMobilityModel [class]
-    module.add_class('HierarchicalMobilityModel', allow_subclassing=True, parent=root_module['ns3::MobilityModel'])
+    module.add_class('HierarchicalMobilityModel', parent=root_module['ns3::MobilityModel'])
     ## static-mobility-model.h: ns3::StaticMobilityModel [class]
-    module.add_class('StaticMobilityModel', allow_subclassing=True, parent=root_module['ns3::MobilityModel'])
+    module.add_class('StaticMobilityModel', parent=root_module['ns3::MobilityModel'])
     
     ## Register a nested module for the namespace internal
     
--- a/bindings/python/ns3_module_node.py	Wed Jul 16 10:46:51 2008 +0100
+++ b/bindings/python/ns3_module_node.py	Wed Jul 16 14:33:44 2008 +0100
@@ -40,15 +40,15 @@
     ## ipv4-address.h: ns3::Ipv4Mask [class]
     module.add_class('Ipv4Mask')
     ## ipv4-address.h: ns3::Ipv4AddressValue [class]
-    module.add_class('Ipv4AddressValue', allow_subclassing=True, parent=root_module['ns3::AttributeValue'])
+    module.add_class('Ipv4AddressValue', parent=root_module['ns3::AttributeValue'])
     ## ipv4.h: ns3::Ipv4RoutingProtocol [class]
-    module.add_class('Ipv4RoutingProtocol', allow_subclassing=True, parent=root_module['ns3::Object'])
+    module.add_class('Ipv4RoutingProtocol', parent=root_module['ns3::Object'])
     ## mac48-address.h: ns3::Mac48AddressValue [class]
-    module.add_class('Mac48AddressValue', allow_subclassing=True, parent=root_module['ns3::AttributeValue'])
+    module.add_class('Mac48AddressValue', parent=root_module['ns3::AttributeValue'])
     ## ipv4-address.h: ns3::Ipv4MaskValue [class]
-    module.add_class('Ipv4MaskValue', allow_subclassing=True, parent=root_module['ns3::AttributeValue'])
+    module.add_class('Ipv4MaskValue', parent=root_module['ns3::AttributeValue'])
     ## socket.h: ns3::SocketAddressTag [class]
-    module.add_class('SocketAddressTag', allow_subclassing=True, parent=root_module['ns3::Tag'])
+    module.add_class('SocketAddressTag', parent=root_module['ns3::Tag'])
     ## inet-socket-address.h: ns3::InetSocketAddress [class]
     module.add_class('InetSocketAddress')
     ## inet-socket-address.h: ns3::InetSocketAddress [class]
@@ -58,51 +58,53 @@
     ## ipv4-address.h: ns3::Ipv4Address [class]
     root_module['ns3::Ipv4Address'].implicitly_converts_to(root_module['ns3::Address'])
     ## application.h: ns3::Application [class]
-    module.add_class('Application', allow_subclassing=True, parent=root_module['ns3::Object'])
+    module.add_class('Application', parent=root_module['ns3::Object'])
     ## queue.h: ns3::Queue [class]
-    module.add_class('Queue', allow_subclassing=True, parent=root_module['ns3::Object'])
+    module.add_class('Queue', parent=root_module['ns3::Object'])
     ## socket.h: ns3::Socket [class]
-    module.add_class('Socket', allow_subclassing=True, parent=root_module['ns3::Object'])
+    module.add_class('Socket', parent=root_module['ns3::Object'])
     ## socket.h: ns3::Socket::SocketErrno [enumeration]
     module.add_enum('SocketErrno', ['ERROR_NOTERROR', 'ERROR_ISCONN', 'ERROR_NOTCONN', 'ERROR_MSGSIZE', 'ERROR_AGAIN', 'ERROR_SHUTDOWN', 'ERROR_OPNOTSUPP', 'ERROR_AFNOSUPPORT', 'ERROR_INVAL', 'ERROR_BADF', 'ERROR_NOROUTETOHOST', 'SOCKET_ERRNO_LAST'], outer_class=root_module['ns3::Socket'])
     ## ipv4-header.h: ns3::Ipv4Header [class]
-    module.add_class('Ipv4Header', allow_subclassing=True, parent=root_module['ns3::Header'])
+    module.add_class('Ipv4Header', parent=root_module['ns3::Header'])
     ## udp-socket.h: ns3::UdpSocket [class]
-    module.add_class('UdpSocket', allow_subclassing=True, parent=root_module['ns3::Socket'])
+    module.add_class('UdpSocket', parent=root_module['ns3::Socket'])
     ## net-device.h: ns3::NetDevice [class]
-    module.add_class('NetDevice', allow_subclassing=True, parent=root_module['ns3::Object'])
-    ## channel.h: ns3::Channel [class]
-    module.add_class('Channel', allow_subclassing=True, parent=root_module['ns3::Object'])
-    ## simple-channel.h: ns3::SimpleChannel [class]
-    module.add_class('SimpleChannel', allow_subclassing=True, parent=root_module['ns3::Channel'])
+    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'])
     ## address.h: ns3::AddressValue [class]
-    module.add_class('AddressValue', allow_subclassing=True, parent=root_module['ns3::AttributeValue'])
+    module.add_class('AddressValue', parent=root_module['ns3::AttributeValue'])
     ## node.h: ns3::Node [class]
-    module.add_class('Node', allow_subclassing=True, parent=root_module['ns3::Object'])
+    module.add_class('Node', parent=root_module['ns3::Object'])
     ## tcp-socket.h: ns3::TcpSocket [class]
-    module.add_class('TcpSocket', allow_subclassing=True, parent=root_module['ns3::Socket'])
+    module.add_class('TcpSocket', parent=root_module['ns3::Socket'])
+    ## channel.h: ns3::Channel [class]
+    module.add_class('Channel', parent=root_module['ns3::Object'])
     ## ethernet-header.h: ns3::EthernetHeader [class]
-    module.add_class('EthernetHeader', allow_subclassing=True, parent=root_module['ns3::Header'])
+    module.add_class('EthernetHeader', parent=root_module['ns3::Header'])
     ## socket.h: ns3::SocketIpTtlTag [class]
-    module.add_class('SocketIpTtlTag', allow_subclassing=True, parent=root_module['ns3::Tag'])
+    module.add_class('SocketIpTtlTag', parent=root_module['ns3::Tag'])
     ## ipv4.h: ns3::Ipv4 [class]
-    module.add_class('Ipv4', allow_subclassing=True, parent=root_module['ns3::Object'])
+    module.add_class('Ipv4', parent=root_module['ns3::Object'])
     ## socket-factory.h: ns3::SocketFactory [class]
-    module.add_class('SocketFactory', allow_subclassing=True, parent=root_module['ns3::Object'])
+    module.add_class('SocketFactory', parent=root_module['ns3::Object'])
     ## drop-tail-queue.h: ns3::DropTailQueue [class]
-    module.add_class('DropTailQueue', allow_subclassing=True, parent=root_module['ns3::Queue'])
+    module.add_class('DropTailQueue', parent=root_module['ns3::Queue'])
     ## ethernet-trailer.h: ns3::EthernetTrailer [class]
-    module.add_class('EthernetTrailer', allow_subclassing=True, parent=root_module['ns3::Trailer'])
+    module.add_class('EthernetTrailer', parent=root_module['ns3::Trailer'])
     ## llc-snap-header.h: ns3::LlcSnapHeader [class]
-    module.add_class('LlcSnapHeader', allow_subclassing=True, parent=root_module['ns3::Header'])
+    module.add_class('LlcSnapHeader', parent=root_module['ns3::Header'])
     ## udp-socket-factory.h: ns3::UdpSocketFactory [class]
     module.add_class('UdpSocketFactory', parent=root_module['ns3::SocketFactory'])
     ## simple-net-device.h: ns3::SimpleNetDevice [class]
-    module.add_class('SimpleNetDevice', allow_subclassing=True, parent=root_module['ns3::NetDevice'])
+    module.add_class('SimpleNetDevice', parent=root_module['ns3::NetDevice'])
+    ## simple-channel.h: ns3::SimpleChannel [class]
+    module.add_class('SimpleChannel', parent=root_module['ns3::Channel'])
     ## tcp-socket-factory.h: ns3::TcpSocketFactory [class]
     module.add_class('TcpSocketFactory', parent=root_module['ns3::SocketFactory'])
     ## packet-socket-factory.h: ns3::PacketSocketFactory [class]
-    module.add_class('PacketSocketFactory', allow_subclassing=True, parent=root_module['ns3::SocketFactory'])
+    module.add_class('PacketSocketFactory', parent=root_module['ns3::SocketFactory'])
     
     ## Register a nested module for the namespace internal
     
@@ -171,11 +173,10 @@
     register_Ns3Ipv4Header_methods(root_module, root_module['ns3::Ipv4Header'])
     register_Ns3UdpSocket_methods(root_module, root_module['ns3::UdpSocket'])
     register_Ns3NetDevice_methods(root_module, root_module['ns3::NetDevice'])
-    register_Ns3Channel_methods(root_module, root_module['ns3::Channel'])
-    register_Ns3SimpleChannel_methods(root_module, root_module['ns3::SimpleChannel'])
     register_Ns3AddressValue_methods(root_module, root_module['ns3::AddressValue'])
     register_Ns3Node_methods(root_module, root_module['ns3::Node'])
     register_Ns3TcpSocket_methods(root_module, root_module['ns3::TcpSocket'])
+    register_Ns3Channel_methods(root_module, root_module['ns3::Channel'])
     register_Ns3EthernetHeader_methods(root_module, root_module['ns3::EthernetHeader'])
     register_Ns3SocketIpTtlTag_methods(root_module, root_module['ns3::SocketIpTtlTag'])
     register_Ns3Ipv4_methods(root_module, root_module['ns3::Ipv4'])
@@ -185,6 +186,7 @@
     register_Ns3LlcSnapHeader_methods(root_module, root_module['ns3::LlcSnapHeader'])
     register_Ns3UdpSocketFactory_methods(root_module, root_module['ns3::UdpSocketFactory'])
     register_Ns3SimpleNetDevice_methods(root_module, root_module['ns3::SimpleNetDevice'])
+    register_Ns3SimpleChannel_methods(root_module, root_module['ns3::SimpleChannel'])
     register_Ns3TcpSocketFactory_methods(root_module, root_module['ns3::TcpSocketFactory'])
     register_Ns3PacketSocketFactory_methods(root_module, root_module['ns3::PacketSocketFactory'])
     return
@@ -851,49 +853,19 @@
     cls.add_method('IsPointToPoint', 'bool', [], is_pure_virtual=True, is_const=True, is_virtual=True)
     ## net-device.h: bool ns3::NetDevice::Send(ns3::Ptr<ns3::Packet> packet, ns3::Address const & dest, uint16_t protocolNumber) [member function]
     cls.add_method('Send', 'bool', [param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Address&', 'dest', is_const=True), param('uint16_t', 'protocolNumber')], is_pure_virtual=True, is_virtual=True)
+    ## net-device.h: bool ns3::NetDevice::SendFrom(ns3::Ptr<ns3::Packet> packet, ns3::Address const & source, ns3::Address const & dest, uint16_t protocolNumber) [member function]
+    cls.add_method('SendFrom', 'bool', [param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Address&', 'source', is_const=True), param('ns3::Address&', 'dest', is_const=True), param('uint16_t', 'protocolNumber')], is_pure_virtual=True, is_virtual=True)
     ## net-device.h: ns3::Ptr<ns3::Node> ns3::NetDevice::GetNode() const [member function]
     cls.add_method('GetNode', 'ns3::Ptr< ns3::Node >', [], is_pure_virtual=True, is_const=True, is_virtual=True)
     ## net-device.h: void ns3::NetDevice::SetNode(ns3::Ptr<ns3::Node> node) [member function]
     cls.add_method('SetNode', 'void', [param('ns3::Ptr< ns3::Node >', 'node')], is_pure_virtual=True, is_virtual=True)
     ## net-device.h: bool ns3::NetDevice::NeedsArp() const [member function]
     cls.add_method('NeedsArp', 'bool', [], is_pure_virtual=True, is_const=True, is_virtual=True)
-    ## net-device.h: void ns3::NetDevice::SetReceiveCallback(ns3::Callback<bool, ns3::Ptr<ns3::NetDevice>, ns3::Ptr<ns3::Packet>, 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 >, unsigned short, ns3::Address const&, ns3::empty, ns3::empty >', 'cb')], is_pure_virtual=True, is_virtual=True)
+    ## net-device.h: void ns3::NetDevice::SetReceiveCallback(ns3::Callback<bool, ns3::Ptr<ns3::NetDevice>, ns3::Ptr<ns3::Packet>, unsigned short, ns3::Address const&, ns3::Address const&, ns3::NetDevice::PacketType> cb) [member function]
+    cls.add_method('SetReceiveCallback', 'void', [param('ns3::Callback< bool, ns3::Ptr< ns3::NetDevice >, ns3::Ptr< ns3::Packet >, unsigned short, ns3::Address const&, ns3::Address const&, ns3::NetDevice::PacketType >', 'cb')], is_pure_virtual=True, is_virtual=True)
     cls.add_constructor([])
     return
 
-def register_Ns3Channel_methods(root_module, cls):
-    ## channel.h: static ns3::TypeId ns3::Channel::GetTypeId() [member function]
-    cls.add_method('GetTypeId', 'ns3::TypeId', [], is_static=True)
-    ## channel.h: ns3::Channel::Channel() [constructor]
-    cls.add_constructor([], visibility='public')
-    ## channel.h: ns3::Channel::Channel(std::string name) [constructor]
-    cls.add_constructor([param('std::string', 'name')], visibility='public')
-    ## channel.h: void ns3::Channel::SetName(std::string arg0) [member function]
-    cls.add_method('SetName', 'void', [param('std::string', 'arg0')])
-    ## channel.h: std::string ns3::Channel::GetName() [member function]
-    cls.add_method('GetName', 'std::string', [])
-    ## channel.h: uint32_t ns3::Channel::GetNDevices() const [member function]
-    cls.add_method('GetNDevices', 'uint32_t', [], is_pure_virtual=True, is_const=True, is_virtual=True)
-    ## channel.h: ns3::Ptr<ns3::NetDevice> ns3::Channel::GetDevice(uint32_t i) const [member function]
-    cls.add_method('GetDevice', 'ns3::Ptr< ns3::NetDevice >', [param('uint32_t', 'i')], is_pure_virtual=True, is_const=True, is_virtual=True)
-    return
-
-def register_Ns3SimpleChannel_methods(root_module, cls):
-    ## simple-channel.h: static ns3::TypeId ns3::SimpleChannel::GetTypeId() [member function]
-    cls.add_method('GetTypeId', 'ns3::TypeId', [], is_static=True)
-    ## simple-channel.h: ns3::SimpleChannel::SimpleChannel() [constructor]
-    cls.add_constructor([], visibility='public')
-    ## simple-channel.h: void ns3::SimpleChannel::Send(ns3::Ptr<ns3::Packet> p, uint16_t protocol, ns3::Mac48Address to, ns3::Mac48Address from, ns3::Ptr<ns3::SimpleNetDevice> sender) [member function]
-    cls.add_method('Send', 'void', [param('ns3::Ptr< ns3::Packet >', 'p'), param('uint16_t', 'protocol'), param('ns3::Mac48Address', 'to'), param('ns3::Mac48Address', 'from'), param('ns3::Ptr< ns3::SimpleNetDevice >', 'sender')])
-    ## simple-channel.h: void ns3::SimpleChannel::Add(ns3::Ptr<ns3::SimpleNetDevice> device) [member function]
-    cls.add_method('Add', 'void', [param('ns3::Ptr< ns3::SimpleNetDevice >', 'device')])
-    ## simple-channel.h: uint32_t ns3::SimpleChannel::GetNDevices() const [member function]
-    cls.add_method('GetNDevices', 'uint32_t', [], is_const=True, is_virtual=True)
-    ## simple-channel.h: ns3::Ptr<ns3::NetDevice> ns3::SimpleChannel::GetDevice(uint32_t i) const [member function]
-    cls.add_method('GetDevice', 'ns3::Ptr< ns3::NetDevice >', [param('uint32_t', 'i')], is_const=True, is_virtual=True)
-    return
-
 def register_Ns3AddressValue_methods(root_module, cls):
     ## address.h: ns3::AddressValue::AddressValue() [constructor]
     cls.add_constructor([], visibility='public')
@@ -936,10 +908,14 @@
     cls.add_method('GetFirstApplication', 'ns3::Ptr< ns3::Application >', [param('ns3::TypeId', 'tid')])
     ## node.h: uint32_t ns3::Node::GetNApplications() const [member function]
     cls.add_method('GetNApplications', 'uint32_t', [], is_const=True)
-    ## node.h: void ns3::Node::RegisterProtocolHandler(ns3::Callback<void, ns3::Ptr<ns3::NetDevice>, ns3::Ptr<ns3::Packet>, unsigned short, ns3::Address const&, ns3::empty, ns3::empty> handler, uint16_t protocolType, ns3::Ptr<ns3::NetDevice> device) [member function]
-    cls.add_method('RegisterProtocolHandler', 'void', [param('ns3::Callback< void, ns3::Ptr< ns3::NetDevice >, ns3::Ptr< ns3::Packet >, unsigned short, ns3::Address const&, ns3::empty, ns3::empty >', 'handler'), param('uint16_t', 'protocolType'), param('ns3::Ptr< ns3::NetDevice >', 'device')])
-    ## node.h: void ns3::Node::UnregisterProtocolHandler(ns3::Callback<void, ns3::Ptr<ns3::NetDevice>, ns3::Ptr<ns3::Packet>, unsigned short, ns3::Address const&, ns3::empty, ns3::empty> handler) [member function]
-    cls.add_method('UnregisterProtocolHandler', 'void', [param('ns3::Callback< void, ns3::Ptr< ns3::NetDevice >, ns3::Ptr< ns3::Packet >, unsigned short, ns3::Address const&, ns3::empty, ns3::empty >', 'handler')])
+    ## node.h: void ns3::Node::RegisterProtocolHandler(ns3::Callback<void, ns3::Ptr<ns3::NetDevice>, ns3::Ptr<ns3::Packet>, unsigned short, ns3::Address const&, ns3::Address const&, ns3::NetDevice::PacketType> handler, uint16_t protocolType, ns3::Ptr<ns3::NetDevice> device) [member function]
+    cls.add_method('RegisterProtocolHandler', 'void', [param('ns3::Callback< void, ns3::Ptr< ns3::NetDevice >, ns3::Ptr< ns3::Packet >, unsigned short, ns3::Address const&, ns3::Address const&, ns3::NetDevice::PacketType >', 'handler'), param('uint16_t', 'protocolType'), param('ns3::Ptr< ns3::NetDevice >', 'device')])
+    ## node.h: void ns3::Node::UnregisterProtocolHandler(ns3::Callback<void, ns3::Ptr<ns3::NetDevice>, ns3::Ptr<ns3::Packet>, unsigned short, ns3::Address const&, ns3::Address const&, ns3::NetDevice::PacketType> handler) [member function]
+    cls.add_method('UnregisterProtocolHandler', 'void', [param('ns3::Callback< void, ns3::Ptr< ns3::NetDevice >, ns3::Ptr< ns3::Packet >, unsigned short, ns3::Address const&, ns3::Address const&, ns3::NetDevice::PacketType >', 'handler')])
+    ## node.h: void ns3::Node::RegisterPromiscuousProtocolHandler(ns3::Callback<void,ns3::Ptr<ns3::NetDevice>,ns3::Ptr<ns3::Packet>,short unsigned int,const ns3::Address&,const ns3::Address&,bool> handler, uint16_t protocolType, ns3::Ptr<ns3::NetDevice> device) [member function]
+    cls.add_method('RegisterPromiscuousProtocolHandler', 'void', [param('ns3::Callback< void, ns3::Ptr< ns3::NetDevice >, ns3::Ptr< ns3::Packet >, short unsigned int, const ns3::Address&, const ns3::Address&, bool >', 'handler'), param('uint16_t', 'protocolType'), param('ns3::Ptr< ns3::NetDevice >', 'device')])
+    ## node.h: void ns3::Node::UnregisterPromiscuousProtocolHandler(ns3::Callback<void,ns3::Ptr<ns3::NetDevice>,ns3::Ptr<ns3::Packet>,short unsigned int,const ns3::Address&,const ns3::Address&,bool> handler) [member function]
+    cls.add_method('UnregisterPromiscuousProtocolHandler', 'void', [param('ns3::Callback< void, ns3::Ptr< ns3::NetDevice >, ns3::Ptr< ns3::Packet >, short unsigned int, const ns3::Address&, const ns3::Address&, bool >', 'handler')])
     ## node.h: void ns3::Node::DoDispose() [member function]
     cls.add_method('DoDispose', 'void', [], visibility='protected', is_virtual=True)
     ## node.h: void ns3::Node::NotifyDeviceAdded(ns3::Ptr<ns3::NetDevice> device) [member function]
@@ -993,6 +969,23 @@
     cls.add_method('GetDelAckMaxCount', 'uint32_t', [], is_pure_virtual=True, is_const=True, visibility='private', is_virtual=True)
     return
 
+def register_Ns3Channel_methods(root_module, cls):
+    ## channel.h: static ns3::TypeId ns3::Channel::GetTypeId() [member function]
+    cls.add_method('GetTypeId', 'ns3::TypeId', [], is_static=True)
+    ## channel.h: ns3::Channel::Channel() [constructor]
+    cls.add_constructor([], visibility='public')
+    ## channel.h: ns3::Channel::Channel(std::string name) [constructor]
+    cls.add_constructor([param('std::string', 'name')], visibility='public')
+    ## channel.h: void ns3::Channel::SetName(std::string arg0) [member function]
+    cls.add_method('SetName', 'void', [param('std::string', 'arg0')])
+    ## channel.h: std::string ns3::Channel::GetName() [member function]
+    cls.add_method('GetName', 'std::string', [])
+    ## channel.h: uint32_t ns3::Channel::GetNDevices() const [member function]
+    cls.add_method('GetNDevices', 'uint32_t', [], is_pure_virtual=True, is_const=True, is_virtual=True)
+    ## channel.h: ns3::Ptr<ns3::NetDevice> ns3::Channel::GetDevice(uint32_t i) const [member function]
+    cls.add_method('GetDevice', 'ns3::Ptr< ns3::NetDevice >', [param('uint32_t', 'i')], is_pure_virtual=True, is_const=True, is_virtual=True)
+    return
+
 def register_Ns3EthernetHeader_methods(root_module, cls):
     ## ethernet-header.h: ns3::EthernetHeader::EthernetHeader(bool hasPreamble) [constructor]
     cls.add_constructor([param('bool', 'hasPreamble')], visibility='public')
@@ -1255,18 +1248,35 @@
     cls.add_method('IsPointToPoint', 'bool', [], is_const=True, is_virtual=True)
     ## simple-net-device.h: bool ns3::SimpleNetDevice::Send(ns3::Ptr<ns3::Packet> packet, ns3::Address const & dest, uint16_t protocolNumber) [member function]
     cls.add_method('Send', 'bool', [param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Address&', 'dest', is_const=True), param('uint16_t', 'protocolNumber')], is_virtual=True)
+    ## simple-net-device.h: bool ns3::SimpleNetDevice::SendFrom(ns3::Ptr<ns3::Packet> packet, ns3::Address const & source, ns3::Address const & dest, uint16_t protocolNumber) [member function]
+    cls.add_method('SendFrom', 'bool', [param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Address&', 'source', is_const=True), param('ns3::Address&', 'dest', is_const=True), param('uint16_t', 'protocolNumber')], is_virtual=True)
     ## simple-net-device.h: ns3::Ptr<ns3::Node> ns3::SimpleNetDevice::GetNode() const [member function]
     cls.add_method('GetNode', 'ns3::Ptr< ns3::Node >', [], is_const=True, is_virtual=True)
     ## simple-net-device.h: void ns3::SimpleNetDevice::SetNode(ns3::Ptr<ns3::Node> node) [member function]
     cls.add_method('SetNode', 'void', [param('ns3::Ptr< ns3::Node >', 'node')], is_virtual=True)
     ## simple-net-device.h: bool ns3::SimpleNetDevice::NeedsArp() const [member function]
     cls.add_method('NeedsArp', 'bool', [], is_const=True, is_virtual=True)
-    ## simple-net-device.h: void ns3::SimpleNetDevice::SetReceiveCallback(ns3::Callback<bool, ns3::Ptr<ns3::NetDevice>, ns3::Ptr<ns3::Packet>, 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 >, unsigned short, ns3::Address const&, ns3::empty, ns3::empty >', 'cb')], is_virtual=True)
+    ## simple-net-device.h: void ns3::SimpleNetDevice::SetReceiveCallback(ns3::Callback<bool, ns3::Ptr<ns3::NetDevice>, ns3::Ptr<ns3::Packet>, unsigned short, ns3::Address const&, ns3::Address const&, ns3::NetDevice::PacketType> cb) [member function]
+    cls.add_method('SetReceiveCallback', 'void', [param('ns3::Callback< bool, ns3::Ptr< ns3::NetDevice >, ns3::Ptr< ns3::Packet >, unsigned short, ns3::Address const&, ns3::Address const&, ns3::NetDevice::PacketType >', 'cb')], is_virtual=True)
     ## simple-net-device.h: void ns3::SimpleNetDevice::DoDispose() [member function]
     cls.add_method('DoDispose', 'void', [], visibility='protected', is_virtual=True)
     return
 
+def register_Ns3SimpleChannel_methods(root_module, cls):
+    ## simple-channel.h: static ns3::TypeId ns3::SimpleChannel::GetTypeId() [member function]
+    cls.add_method('GetTypeId', 'ns3::TypeId', [], is_static=True)
+    ## simple-channel.h: ns3::SimpleChannel::SimpleChannel() [constructor]
+    cls.add_constructor([], visibility='public')
+    ## simple-channel.h: void ns3::SimpleChannel::Send(ns3::Ptr<ns3::Packet> p, uint16_t protocol, ns3::Mac48Address to, ns3::Mac48Address from, ns3::Ptr<ns3::SimpleNetDevice> sender) [member function]
+    cls.add_method('Send', 'void', [param('ns3::Ptr< ns3::Packet >', 'p'), param('uint16_t', 'protocol'), param('ns3::Mac48Address', 'to'), param('ns3::Mac48Address', 'from'), param('ns3::Ptr< ns3::SimpleNetDevice >', 'sender')])
+    ## simple-channel.h: void ns3::SimpleChannel::Add(ns3::Ptr<ns3::SimpleNetDevice> device) [member function]
+    cls.add_method('Add', 'void', [param('ns3::Ptr< ns3::SimpleNetDevice >', 'device')])
+    ## simple-channel.h: uint32_t ns3::SimpleChannel::GetNDevices() const [member function]
+    cls.add_method('GetNDevices', 'uint32_t', [], is_const=True, is_virtual=True)
+    ## simple-channel.h: ns3::Ptr<ns3::NetDevice> ns3::SimpleChannel::GetDevice(uint32_t i) const [member function]
+    cls.add_method('GetDevice', 'ns3::Ptr< ns3::NetDevice >', [param('uint32_t', 'i')], is_const=True, is_virtual=True)
+    return
+
 def register_Ns3TcpSocketFactory_methods(root_module, cls):
     ## tcp-socket-factory.h: static ns3::TypeId ns3::TcpSocketFactory::GetTypeId() [member function]
     cls.add_method('GetTypeId', 'ns3::TypeId', [], is_static=True)
--- a/bindings/python/ns3_module_olsr.py	Wed Jul 16 10:46:51 2008 +0100
+++ b/bindings/python/ns3_module_olsr.py	Wed Jul 16 14:33:44 2008 +0100
@@ -44,7 +44,7 @@
     root_module = module.get_root()
     
     ## olsr-header.h: ns3::olsr::MessageHeader [class]
-    module.add_class('MessageHeader', allow_subclassing=True, parent=root_module['ns3::Header'])
+    module.add_class('MessageHeader', parent=root_module['ns3::Header'])
     ## olsr-header.h: ns3::olsr::MessageHeader::MessageType [enumeration]
     module.add_enum('MessageType', ['HELLO_MESSAGE', 'TC_MESSAGE', 'MID_MESSAGE', 'HNA_MESSAGE'], outer_class=root_module['ns3::olsr::MessageHeader'])
     ## olsr-header.h: ns3::olsr::MessageHeader::Mid [struct]
@@ -60,9 +60,9 @@
     ## olsr-header.h: ns3::olsr::MessageHeader::Hna::Association [struct]
     module.add_class('Association', outer_class=root_module['ns3::olsr::MessageHeader::Hna'])
     ## olsr-agent.h: ns3::olsr::Agent [class]
-    module.add_class('Agent', allow_subclassing=True, parent=root_module['ns3::Object'])
+    module.add_class('Agent', parent=root_module['ns3::Object'])
     ## olsr-header.h: ns3::olsr::PacketHeader [class]
-    module.add_class('PacketHeader', allow_subclassing=True, parent=root_module['ns3::Header'])
+    module.add_class('PacketHeader', parent=root_module['ns3::Header'])
 
 def register_methods(root_module):
     register_Ns3OlsrMessageHeader_methods(root_module, root_module['ns3::olsr::MessageHeader'])
--- a/bindings/python/ns3_module_onoff.py	Wed Jul 16 10:46:51 2008 +0100
+++ b/bindings/python/ns3_module_onoff.py	Wed Jul 16 14:33:44 2008 +0100
@@ -4,7 +4,7 @@
     root_module = module.get_root()
     
     ## onoff-application.h: ns3::OnOffApplication [class]
-    module.add_class('OnOffApplication', allow_subclassing=True, parent=root_module['ns3::Application'])
+    module.add_class('OnOffApplication', parent=root_module['ns3::Application'])
     
     ## Register a nested module for the namespace internal
     
--- a/bindings/python/ns3_module_packet_sink.py	Wed Jul 16 10:46:51 2008 +0100
+++ b/bindings/python/ns3_module_packet_sink.py	Wed Jul 16 14:33:44 2008 +0100
@@ -4,7 +4,7 @@
     root_module = module.get_root()
     
     ## packet-sink.h: ns3::PacketSink [class]
-    module.add_class('PacketSink', allow_subclassing=True, parent=root_module['ns3::Application'])
+    module.add_class('PacketSink', parent=root_module['ns3::Application'])
     
     ## Register a nested module for the namespace internal
     
--- a/bindings/python/ns3_module_point_to_point.py	Wed Jul 16 10:46:51 2008 +0100
+++ b/bindings/python/ns3_module_point_to_point.py	Wed Jul 16 14:33:44 2008 +0100
@@ -4,9 +4,9 @@
     root_module = module.get_root()
     
     ## point-to-point-channel.h: ns3::PointToPointChannel [class]
-    module.add_class('PointToPointChannel', allow_subclassing=True, parent=root_module['ns3::Channel'])
+    module.add_class('PointToPointChannel', parent=root_module['ns3::Channel'])
     ## point-to-point-net-device.h: ns3::PointToPointNetDevice [class]
-    module.add_class('PointToPointNetDevice', allow_subclassing=True, parent=root_module['ns3::NetDevice'])
+    module.add_class('PointToPointNetDevice', parent=root_module['ns3::NetDevice'])
     
     ## Register a nested module for the namespace internal
     
@@ -123,14 +123,16 @@
     cls.add_method('IsPointToPoint', 'bool', [], is_const=True, is_virtual=True)
     ## point-to-point-net-device.h: bool ns3::PointToPointNetDevice::Send(ns3::Ptr<ns3::Packet> packet, ns3::Address const & dest, uint16_t protocolNumber) [member function]
     cls.add_method('Send', 'bool', [param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Address&', 'dest', is_const=True), param('uint16_t', 'protocolNumber')], is_virtual=True)
+    ## point-to-point-net-device.h: bool ns3::PointToPointNetDevice::SendFrom(ns3::Ptr<ns3::Packet> packet, ns3::Address const & source, ns3::Address const & dest, uint16_t protocolNumber) [member function]
+    cls.add_method('SendFrom', 'bool', [param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Address&', 'source', is_const=True), param('ns3::Address&', 'dest', is_const=True), param('uint16_t', 'protocolNumber')], is_virtual=True)
     ## point-to-point-net-device.h: ns3::Ptr<ns3::Node> ns3::PointToPointNetDevice::GetNode() const [member function]
     cls.add_method('GetNode', 'ns3::Ptr< ns3::Node >', [], is_const=True, is_virtual=True)
     ## point-to-point-net-device.h: void ns3::PointToPointNetDevice::SetNode(ns3::Ptr<ns3::Node> node) [member function]
     cls.add_method('SetNode', 'void', [param('ns3::Ptr< ns3::Node >', 'node')], is_virtual=True)
     ## point-to-point-net-device.h: bool ns3::PointToPointNetDevice::NeedsArp() const [member function]
     cls.add_method('NeedsArp', 'bool', [], is_const=True, is_virtual=True)
-    ## point-to-point-net-device.h: void ns3::PointToPointNetDevice::SetReceiveCallback(ns3::Callback<bool, ns3::Ptr<ns3::NetDevice>, ns3::Ptr<ns3::Packet>, 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 >, unsigned short, ns3::Address const&, ns3::empty, ns3::empty >', 'cb')], is_virtual=True)
+    ## point-to-point-net-device.h: void ns3::PointToPointNetDevice::SetReceiveCallback(ns3::Callback<bool, ns3::Ptr<ns3::NetDevice>, ns3::Ptr<ns3::Packet>, unsigned short, ns3::Address const&, ns3::Address const&, ns3::NetDevice::PacketType> cb) [member function]
+    cls.add_method('SetReceiveCallback', 'void', [param('ns3::Callback< bool, ns3::Ptr< ns3::NetDevice >, ns3::Ptr< ns3::Packet >, unsigned short, ns3::Address const&, ns3::Address const&, ns3::NetDevice::PacketType >', 'cb')], is_virtual=True)
     ## point-to-point-net-device.h: void ns3::PointToPointNetDevice::DoDispose() [member function]
     cls.add_method('DoDispose', 'void', [], visibility='private', is_virtual=True)
     return
--- a/bindings/python/ns3_module_simulator.py	Wed Jul 16 10:46:51 2008 +0100
+++ b/bindings/python/ns3_module_simulator.py	Wed Jul 16 14:33:44 2008 +0100
@@ -28,17 +28,17 @@
     ## nstime.h: ns3::TimeChecker [class]
     module.add_class('TimeChecker', parent=root_module['ns3::AttributeChecker'])
     ## scheduler.h: ns3::Scheduler [class]
-    module.add_class('Scheduler', allow_subclassing=True, parent=root_module['ns3::Object'])
+    module.add_class('Scheduler', parent=root_module['ns3::Object'])
     ## scheduler.h: ns3::Scheduler::EventKey [struct]
     module.add_class('EventKey', outer_class=root_module['ns3::Scheduler'])
     ## nstime.h: ns3::TimeValue [class]
-    module.add_class('TimeValue', allow_subclassing=True, parent=root_module['ns3::AttributeValue'])
+    module.add_class('TimeValue', parent=root_module['ns3::AttributeValue'])
     ## heap-scheduler.h: ns3::HeapScheduler [class]
-    module.add_class('HeapScheduler', allow_subclassing=True, parent=root_module['ns3::Scheduler'])
+    module.add_class('HeapScheduler', parent=root_module['ns3::Scheduler'])
     ## list-scheduler.h: ns3::ListScheduler [class]
-    module.add_class('ListScheduler', allow_subclassing=True, parent=root_module['ns3::Scheduler'])
+    module.add_class('ListScheduler', parent=root_module['ns3::Scheduler'])
     ## map-scheduler.h: ns3::MapScheduler [class]
-    module.add_class('MapScheduler', allow_subclassing=True, parent=root_module['ns3::Scheduler'])
+    module.add_class('MapScheduler', parent=root_module['ns3::Scheduler'])
     
     ## Register a nested module for the namespace internal
     
--- a/bindings/python/ns3_module_udp_echo.py	Wed Jul 16 10:46:51 2008 +0100
+++ b/bindings/python/ns3_module_udp_echo.py	Wed Jul 16 14:33:44 2008 +0100
@@ -4,9 +4,9 @@
     root_module = module.get_root()
     
     ## udp-echo-client.h: ns3::UdpEchoClient [class]
-    module.add_class('UdpEchoClient', allow_subclassing=True, parent=root_module['ns3::Application'])
+    module.add_class('UdpEchoClient', parent=root_module['ns3::Application'])
     ## udp-echo-server.h: ns3::UdpEchoServer [class]
-    module.add_class('UdpEchoServer', allow_subclassing=True, parent=root_module['ns3::Application'])
+    module.add_class('UdpEchoServer', parent=root_module['ns3::Application'])
     
     ## Register a nested module for the namespace internal
     
--- a/bindings/python/ns3_module_wifi.py	Wed Jul 16 10:46:51 2008 +0100
+++ b/bindings/python/ns3_module_wifi.py	Wed Jul 16 14:33:44 2008 +0100
@@ -16,15 +16,15 @@
     ## supported-rates.h: ns3::SupportedRates [class]
     module.add_class('SupportedRates')
     ## ideal-wifi-manager.h: ns3::IdealWifiRemoteStation [class]
-    module.add_class('IdealWifiRemoteStation', allow_subclassing=True, parent=root_module['ns3::WifiRemoteStation'])
+    module.add_class('IdealWifiRemoteStation', parent=root_module['ns3::WifiRemoteStation'])
     ## wifi-mode.h: ns3::WifiModeChecker [class]
     module.add_class('WifiModeChecker', parent=root_module['ns3::AttributeChecker'])
     ## wifi-mode.h: ns3::WifiModeFactory [class]
     module.add_class('WifiModeFactory')
     ## onoe-wifi-manager.h: ns3::OnoeWifiRemoteStation [class]
-    module.add_class('OnoeWifiRemoteStation', allow_subclassing=True, parent=root_module['ns3::WifiRemoteStation'])
+    module.add_class('OnoeWifiRemoteStation', parent=root_module['ns3::WifiRemoteStation'])
     ## rraa-wifi-manager.h: ns3::RraaWifiRemoteStation [class]
-    module.add_class('RraaWifiRemoteStation', allow_subclassing=True, parent=root_module['ns3::WifiRemoteStation'])
+    module.add_class('RraaWifiRemoteStation', parent=root_module['ns3::WifiRemoteStation'])
     ## ssid.h: ns3::Ssid [class]
     module.add_class('Ssid')
     ## wifi-mode.h: ns3::WifiMode [class]
@@ -32,69 +32,69 @@
     ## wifi-mode.h: ns3::WifiMode::ModulationType [enumeration]
     module.add_enum('ModulationType', ['BPSK', 'QAM'], outer_class=root_module['ns3::WifiMode'])
     ## ssid.h: ns3::SsidValue [class]
-    module.add_class('SsidValue', allow_subclassing=True, parent=root_module['ns3::AttributeValue'])
+    module.add_class('SsidValue', parent=root_module['ns3::AttributeValue'])
     ## ssid.h: ns3::SsidChecker [class]
     module.add_class('SsidChecker', parent=root_module['ns3::AttributeChecker'])
     ## constant-rate-wifi-manager.h: ns3::ConstantRateWifiRemoteStation [class]
-    module.add_class('ConstantRateWifiRemoteStation', allow_subclassing=True, parent=root_module['ns3::WifiRemoteStation'])
+    module.add_class('ConstantRateWifiRemoteStation', parent=root_module['ns3::WifiRemoteStation'])
     ## propagation-loss-model.h: ns3::PropagationLossModel [class]
-    module.add_class('PropagationLossModel', allow_subclassing=True, parent=root_module['ns3::Object'])
+    module.add_class('PropagationLossModel', parent=root_module['ns3::Object'])
     ## arf-wifi-manager.h: ns3::ArfWifiRemoteStation [class]
-    module.add_class('ArfWifiRemoteStation', allow_subclassing=True, parent=root_module['ns3::WifiRemoteStation'])
+    module.add_class('ArfWifiRemoteStation', parent=root_module['ns3::WifiRemoteStation'])
     ## wifi-mac.h: ns3::WifiMac [class]
-    module.add_class('WifiMac', allow_subclassing=True, parent=root_module['ns3::Object'])
+    module.add_class('WifiMac', parent=root_module['ns3::Object'])
     ## nqap-wifi-mac.h: ns3::NqapWifiMac [class]
-    module.add_class('NqapWifiMac', allow_subclassing=True, parent=root_module['ns3::WifiMac'])
+    module.add_class('NqapWifiMac', parent=root_module['ns3::WifiMac'])
     ## amrr-wifi-manager.h: ns3::AmrrWifiRemoteStation [class]
-    module.add_class('AmrrWifiRemoteStation', allow_subclassing=True, parent=root_module['ns3::WifiRemoteStation'])
+    module.add_class('AmrrWifiRemoteStation', parent=root_module['ns3::WifiRemoteStation'])
     ## composite-propagation-loss-model.h: ns3::CompositePropagationLossModel [class]
-    module.add_class('CompositePropagationLossModel', allow_subclassing=True, parent=root_module['ns3::PropagationLossModel'])
+    module.add_class('CompositePropagationLossModel', parent=root_module['ns3::PropagationLossModel'])
     ## propagation-loss-model.h: ns3::FriisPropagationLossModel [class]
-    module.add_class('FriisPropagationLossModel', allow_subclassing=True, parent=root_module['ns3::PropagationLossModel'])
+    module.add_class('FriisPropagationLossModel', parent=root_module['ns3::PropagationLossModel'])
     ## wifi-remote-station-manager.h: ns3::WifiRemoteStationManager [class]
-    module.add_class('WifiRemoteStationManager', allow_subclassing=True, parent=root_module['ns3::Object'])
+    module.add_class('WifiRemoteStationManager', parent=root_module['ns3::Object'])
     ## wifi-mode.h: ns3::WifiModeValue [class]
-    module.add_class('WifiModeValue', allow_subclassing=True, parent=root_module['ns3::AttributeValue'])
+    module.add_class('WifiModeValue', parent=root_module['ns3::AttributeValue'])
     ## onoe-wifi-manager.h: ns3::OnoeWifiManager [class]
-    module.add_class('OnoeWifiManager', allow_subclassing=True, parent=root_module['ns3::WifiRemoteStationManager'])
+    module.add_class('OnoeWifiManager', parent=root_module['ns3::WifiRemoteStationManager'])
     ## wifi-phy.h: ns3::WifiPhy [class]
-    module.add_class('WifiPhy', allow_subclassing=True, parent=root_module['ns3::Object'])
+    module.add_class('WifiPhy', parent=root_module['ns3::Object'])
     ## wifi-phy.h: ns3::WifiPhy::State [enumeration]
     module.add_enum('State', ['SYNC', 'TX', 'CCA_BUSY', 'IDLE'], outer_class=root_module['ns3::WifiPhy'])
     ## wifi-channel.h: ns3::WifiChannel [class]
-    module.add_class('WifiChannel', allow_subclassing=True, parent=root_module['ns3::Channel'])
+    module.add_class('WifiChannel', parent=root_module['ns3::Channel'])
     ## propagation-loss-model.h: ns3::LogDistancePropagationLossModel [class]
-    module.add_class('LogDistancePropagationLossModel', allow_subclassing=True, parent=root_module['ns3::PropagationLossModel'])
+    module.add_class('LogDistancePropagationLossModel', parent=root_module['ns3::PropagationLossModel'])
     ## constant-rate-wifi-manager.h: ns3::ConstantRateWifiManager [class]
-    module.add_class('ConstantRateWifiManager', allow_subclassing=True, parent=root_module['ns3::WifiRemoteStationManager'])
+    module.add_class('ConstantRateWifiManager', parent=root_module['ns3::WifiRemoteStationManager'])
     ## aarf-wifi-manager.h: ns3::AarfWifiRemoteStation [class]
-    module.add_class('AarfWifiRemoteStation', allow_subclassing=True, parent=root_module['ns3::ArfWifiRemoteStation'])
+    module.add_class('AarfWifiRemoteStation', parent=root_module['ns3::ArfWifiRemoteStation'])
     ## propagation-delay-model.h: ns3::PropagationDelayModel [class]
-    module.add_class('PropagationDelayModel', allow_subclassing=True, parent=root_module['ns3::Object'])
+    module.add_class('PropagationDelayModel', parent=root_module['ns3::Object'])
     ## adhoc-wifi-mac.h: ns3::AdhocWifiMac [class]
-    module.add_class('AdhocWifiMac', allow_subclassing=True, parent=root_module['ns3::WifiMac'])
+    module.add_class('AdhocWifiMac', parent=root_module['ns3::WifiMac'])
     ## jakes-propagation-loss-model.h: ns3::JakesPropagationLossModel [class]
-    module.add_class('JakesPropagationLossModel', allow_subclassing=True, parent=root_module['ns3::PropagationLossModel'])
+    module.add_class('JakesPropagationLossModel', parent=root_module['ns3::PropagationLossModel'])
     ## propagation-delay-model.h: ns3::ConstantSpeedPropagationDelayModel [class]
-    module.add_class('ConstantSpeedPropagationDelayModel', allow_subclassing=True, parent=root_module['ns3::PropagationDelayModel'])
+    module.add_class('ConstantSpeedPropagationDelayModel', parent=root_module['ns3::PropagationDelayModel'])
     ## wifi-net-device.h: ns3::WifiNetDevice [class]
-    module.add_class('WifiNetDevice', allow_subclassing=True, parent=root_module['ns3::NetDevice'])
+    module.add_class('WifiNetDevice', parent=root_module['ns3::NetDevice'])
     ## nqsta-wifi-mac.h: ns3::NqstaWifiMac [class]
-    module.add_class('NqstaWifiMac', allow_subclassing=True, parent=root_module['ns3::WifiMac'])
+    module.add_class('NqstaWifiMac', parent=root_module['ns3::WifiMac'])
     ## propagation-loss-model.h: ns3::RandomPropagationLossModel [class]
-    module.add_class('RandomPropagationLossModel', allow_subclassing=True, parent=root_module['ns3::PropagationLossModel'])
+    module.add_class('RandomPropagationLossModel', parent=root_module['ns3::PropagationLossModel'])
     ## propagation-delay-model.h: ns3::RandomPropagationDelayModel [class]
-    module.add_class('RandomPropagationDelayModel', allow_subclassing=True, parent=root_module['ns3::PropagationDelayModel'])
+    module.add_class('RandomPropagationDelayModel', parent=root_module['ns3::PropagationDelayModel'])
     ## amrr-wifi-manager.h: ns3::AmrrWifiManager [class]
-    module.add_class('AmrrWifiManager', allow_subclassing=True, parent=root_module['ns3::WifiRemoteStationManager'])
+    module.add_class('AmrrWifiManager', parent=root_module['ns3::WifiRemoteStationManager'])
     ## rraa-wifi-manager.h: ns3::RraaWifiManager [class]
-    module.add_class('RraaWifiManager', allow_subclassing=True, parent=root_module['ns3::WifiRemoteStationManager'])
+    module.add_class('RraaWifiManager', parent=root_module['ns3::WifiRemoteStationManager'])
     ## ideal-wifi-manager.h: ns3::IdealWifiManager [class]
-    module.add_class('IdealWifiManager', allow_subclassing=True, parent=root_module['ns3::WifiRemoteStationManager'])
+    module.add_class('IdealWifiManager', parent=root_module['ns3::WifiRemoteStationManager'])
     ## arf-wifi-manager.h: ns3::ArfWifiManager [class]
-    module.add_class('ArfWifiManager', allow_subclassing=True, parent=root_module['ns3::WifiRemoteStationManager'])
+    module.add_class('ArfWifiManager', parent=root_module['ns3::WifiRemoteStationManager'])
     ## aarf-wifi-manager.h: ns3::AarfWifiManager [class]
-    module.add_class('AarfWifiManager', allow_subclassing=True, parent=root_module['ns3::ArfWifiManager'])
+    module.add_class('AarfWifiManager', parent=root_module['ns3::ArfWifiManager'])
     
     ## Register a nested module for the namespace internal
     
@@ -1067,14 +1067,16 @@
     cls.add_method('IsPointToPoint', 'bool', [], is_const=True, is_virtual=True)
     ## wifi-net-device.h: bool ns3::WifiNetDevice::Send(ns3::Ptr<ns3::Packet> packet, ns3::Address const & dest, uint16_t protocolNumber) [member function]
     cls.add_method('Send', 'bool', [param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Address&', 'dest', is_const=True), param('uint16_t', 'protocolNumber')], is_virtual=True)
+    ## wifi-net-device.h: bool ns3::WifiNetDevice::SendFrom(ns3::Ptr<ns3::Packet> packet, ns3::Address const & src, ns3::Address const & dest, uint16_t protocolNumber) [member function]
+    cls.add_method('SendFrom', 'bool', [param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Address&', 'src', is_const=True), param('ns3::Address&', 'dest', is_const=True), param('uint16_t', 'protocolNumber')], is_virtual=True)
     ## wifi-net-device.h: ns3::Ptr<ns3::Node> ns3::WifiNetDevice::GetNode() const [member function]
     cls.add_method('GetNode', 'ns3::Ptr< ns3::Node >', [], is_const=True, is_virtual=True)
     ## wifi-net-device.h: void ns3::WifiNetDevice::SetNode(ns3::Ptr<ns3::Node> node) [member function]
     cls.add_method('SetNode', 'void', [param('ns3::Ptr< ns3::Node >', 'node')], is_virtual=True)
     ## wifi-net-device.h: bool ns3::WifiNetDevice::NeedsArp() const [member function]
     cls.add_method('NeedsArp', 'bool', [], is_const=True, is_virtual=True)
-    ## wifi-net-device.h: void ns3::WifiNetDevice::SetReceiveCallback(ns3::Callback<bool, ns3::Ptr<ns3::NetDevice>, ns3::Ptr<ns3::Packet>, 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 >, unsigned short, ns3::Address const&, ns3::empty, ns3::empty >', 'cb')], is_virtual=True)
+    ## wifi-net-device.h: void ns3::WifiNetDevice::SetReceiveCallback(ns3::Callback<bool, ns3::Ptr<ns3::NetDevice>, ns3::Ptr<ns3::Packet>, unsigned short, ns3::Address const&, ns3::Address const&, ns3::NetDevice::PacketType> cb) [member function]
+    cls.add_method('SetReceiveCallback', 'void', [param('ns3::Callback< bool, ns3::Ptr< ns3::NetDevice >, ns3::Ptr< ns3::Packet >, unsigned short, ns3::Address const&, ns3::Address const&, ns3::NetDevice::PacketType >', 'cb')], is_virtual=True)
     ## wifi-net-device.h: void ns3::WifiNetDevice::DoDispose() [member function]
     cls.add_method('DoDispose', 'void', [], visibility='private', is_virtual=True)
     return
--- a/bindings/python/ns3modulegen_generated.py	Wed Jul 16 10:46:51 2008 +0100
+++ b/bindings/python/ns3modulegen_generated.py	Wed Jul 16 14:33:44 2008 +0100
@@ -22,6 +22,7 @@
 import ns3_module_internet_stack
 import ns3_module_wifi
 import ns3_module_csma
+import ns3_module_bridge
 import ns3_module_packet_sink
 import ns3_module_global_routing
 import ns3_module_onoff
@@ -146,6 +147,17 @@
         ns3_module_csma__local.register_types(module)
     
     root_module.end_section('ns3_module_csma')
+    root_module.begin_section('ns3_module_bridge')
+    ns3_module_bridge.register_types(module)
+    
+    try:
+        import ns3_module_bridge__local
+    except ImportError:
+        pass
+    else:
+        ns3_module_bridge__local.register_types(module)
+    
+    root_module.end_section('ns3_module_bridge')
     root_module.begin_section('ns3_module_packet_sink')
     ns3_module_packet_sink.register_types(module)
     
@@ -364,6 +376,17 @@
         ns3_module_csma__local.register_methods(root_module)
     
     root_module.end_section('ns3_module_csma')
+    root_module.begin_section('ns3_module_bridge')
+    ns3_module_bridge.register_methods(root_module)
+    
+    try:
+        import ns3_module_bridge__local
+    except ImportError:
+        pass
+    else:
+        ns3_module_bridge__local.register_methods(root_module)
+    
+    root_module.end_section('ns3_module_bridge')
     root_module.begin_section('ns3_module_packet_sink')
     ns3_module_packet_sink.register_methods(root_module)
     
@@ -544,6 +567,17 @@
         ns3_module_csma__local.register_functions(root_module)
     
     root_module.end_section('ns3_module_csma')
+    root_module.begin_section('ns3_module_bridge')
+    ns3_module_bridge.register_functions(root_module)
+    
+    try:
+        import ns3_module_bridge__local
+    except ImportError:
+        pass
+    else:
+        ns3_module_bridge__local.register_functions(root_module)
+    
+    root_module.end_section('ns3_module_bridge')
     root_module.begin_section('ns3_module_packet_sink')
     ns3_module_packet_sink.register_functions(root_module)
     
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/examples/csma-bridge.cc	Wed Jul 16 14:33:44 2008 +0100
@@ -0,0 +1,175 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation;
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+// Network topology
+//
+//        n0     n1  
+//        |      | 
+//       ----------
+//       | Switch |
+//       ----------
+//        |      | 
+//        n2     n3  
+//
+//
+// - CBR/UDP flows from n0 to n1 and from n3 to n0
+// - DropTail queues 
+// - Tracing of queues and packet receptions to file "csma-bridge.tr"
+
+#include <iostream>
+#include <fstream>
+
+#include "ns3/simulator-module.h"
+#include "ns3/node-module.h"
+#include "ns3/core-module.h"
+#include "ns3/helper-module.h"
+#include "ns3/bridge-module.h"
+
+using namespace ns3;
+
+NS_LOG_COMPONENT_DEFINE ("CsmaBridgeExample");
+
+int 
+main (int argc, char *argv[])
+{
+  //
+  // Users may find it convenient to turn on explicit debugging
+  // for selected modules; the below lines suggest how to do this
+  //
+#if 0 
+  LogComponentEnable ("CsmaBridgeExample", LOG_LEVEL_INFO);
+#endif
+
+  //
+  // Make the random number generators generate reproducible results.
+  //
+  RandomVariable::UseGlobalSeed (1, 1, 2, 3, 5, 8);
+
+  //
+  // Allow the user to override any of the defaults and the above Bind() at
+  // run-time, via command-line arguments
+  //
+  CommandLine cmd;
+  cmd.Parse (argc, argv);
+
+  //
+  // Explicitly create the nodes required by the topology (shown above).
+  //
+  NS_LOG_INFO ("Create nodes.");
+  NodeContainer terminals;
+  terminals.Create (4);
+
+  NodeContainer csmaSwitch;
+  csmaSwitch.Create (1);
+
+  NS_LOG_INFO ("Build Topology");
+  CsmaHelper csma;
+  csma.SetChannelAttribute ("DataRate", DataRateValue (5000000));
+  csma.SetChannelAttribute ("Delay", TimeValue (MilliSeconds (2)));
+
+  // Create the csma links, from each terminal to the switch
+
+  NetDeviceContainer terminalDevices;
+  NetDeviceContainer switchDevices;
+
+  for (int i = 0; i < 4; i++)
+    {
+      NetDeviceContainer link = csma.Install (NodeContainer (terminals.Get (i), csmaSwitch));
+      terminalDevices.Add (link.Get (0));
+      switchDevices.Add (link.Get (1));
+    }
+
+  // Create the bridge netdevice, which will do the packet switching
+  Ptr<Node> switchNode = csmaSwitch.Get (0);
+  Ptr<BridgeNetDevice> bridgeDevice = CreateObject<BridgeNetDevice> ();
+  switchNode->AddDevice (bridgeDevice);
+
+  for (NetDeviceContainer::Iterator portIter = switchDevices.Begin ();
+       portIter != switchDevices.End (); portIter++)
+    {
+      bridgeDevice->AddBridgePort (*portIter);
+    }
+
+  // Add internet stack to the terminals
+  InternetStackHelper internet;
+  internet.Install (terminals);
+
+  // We've got the "hardware" in place.  Now we need to add IP addresses.
+  //
+  NS_LOG_INFO ("Assign IP Addresses.");
+  Ipv4AddressHelper ipv4;
+  ipv4.SetBase ("10.1.1.0", "255.255.255.0");
+  ipv4.Assign (terminalDevices);
+
+  //
+  // Create an OnOff application to send UDP datagrams from node zero to node 1.
+  //
+  NS_LOG_INFO ("Create Applications.");
+  uint16_t port = 9;   // Discard port (RFC 863)
+
+  OnOffHelper onoff ("ns3::UdpSocketFactory", 
+                     Address (InetSocketAddress (Ipv4Address ("10.1.1.2"), port)));
+  onoff.SetAttribute ("OnTime", RandomVariableValue (ConstantVariable (1)));
+  onoff.SetAttribute ("OffTime", RandomVariableValue (ConstantVariable (0)));
+
+  ApplicationContainer app = onoff.Install (terminals.Get (0));
+  // Start the application
+  app.Start (Seconds (1.0));
+  app.Stop (Seconds (10.0));
+
+  // Create an optional packet sink to receive these packets
+  PacketSinkHelper sink ("ns3::UdpSocketFactory",
+                         Address (InetSocketAddress (Ipv4Address::GetAny (), port)));
+  sink.Install (terminals.Get (1));
+
+  // 
+  // Create a similar flow from n3 to n0, starting at time 1.1 seconds
+  //
+  onoff.SetAttribute ("Remote", 
+                      AddressValue (InetSocketAddress (Ipv4Address ("10.1.1.1"), port)));
+  ApplicationContainer app2 = onoff.Install (terminals.Get (3));
+
+  sink.Install (terminals.Get (0));
+
+  app2.Start (Seconds (1.1));
+  app2.Stop (Seconds (10.0));
+
+  //
+  // Configure tracing of all enqueue, dequeue, and NetDevice receive events.
+  // Trace output will be sent to the file "csma-bridge.tr"
+  //
+  NS_LOG_INFO ("Configure Tracing.");
+  std::ofstream ascii;
+  ascii.open ("csma-bridge.tr");
+  CsmaHelper::EnableAsciiAll (ascii);
+
+  //
+  // Also configure some tcpdump traces; each interface will be traced.
+  // The output files will be named:
+  //     csma-bridge.pcap-<nodeId>-<interfaceId>
+  // and can be read by the "tcpdump -r" command (use "-tt" option to
+  // display timestamps correctly)
+  //
+  CsmaHelper::EnablePcapAll ("csma-bridge");
+
+  //
+  // Now, do the actual simulation.
+  //
+  NS_LOG_INFO ("Run Simulation.");
+  Simulator::Run ();
+  Simulator::Destroy ();
+  NS_LOG_INFO ("Done.");
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/examples/csma-bridge.py	Wed Jul 16 14:33:44 2008 +0100
@@ -0,0 +1,155 @@
+# /*
+#  * This program is free software; you can redistribute it and/or modify
+#  * it under the terms of the GNU General Public License version 2 as
+#  * published by the Free Software Foundation
+#  *
+#  * This program is distributed in the hope that it will be useful,
+#  * but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#  * GNU General Public License for more details.
+#  *
+#  * You should have received a copy of the GNU General Public License
+#  * along with this program; if not, write to the Free Software
+#  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+#  */
+
+# Network topology
+#
+#        n0     n1  
+#        |      | 
+#       ----------
+#       | Switch |
+#       ----------
+#        |      | 
+#        n2     n3  
+#
+#
+# - CBR/UDP flows from n0 to n1 and from n3 to n0
+# - DropTail queues 
+# - Tracing of queues and packet receptions to file "csma-bridge.tr"
+
+import ns3
+
+
+def main(argv):
+    #
+    # Make the random number generators generate reproducible results.
+    #
+    ns3.RandomVariable.UseGlobalSeed(1, 1, 2, 3, 5, 8)
+
+    #
+    # Allow the user to override any of the defaults and the above Bind() at
+    # run-time, via command-line arguments
+    #
+    cmd = ns3.CommandLine()
+    cmd.Parse(argv)
+
+    #
+    # Explicitly create the nodes required by the topology(shown above).
+    #
+    print "Create nodes."
+    terminals = ns3.NodeContainer()
+    terminals.Create(4)
+
+    csmaSwitch = ns3.NodeContainer()
+    csmaSwitch.Create(1)
+
+    print "Build Topology"
+    csma = ns3.CsmaHelper()
+    csma.SetChannelAttribute("DataRate", ns3.DataRateValue(ns3.DataRate(5000000)))
+    csma.SetChannelAttribute("Delay", ns3.TimeValue(ns3.MilliSeconds(2)))
+
+    # Create the csma links, from each terminal to the switch
+
+    terminalDevices = ns3.NetDeviceContainer()
+    switchDevices = ns3.NetDeviceContainer()
+
+    for i in range(4):
+        link = csma.Install(ns3.NodeContainer(ns3.NodeContainer(terminals.Get(i)), csmaSwitch))
+        terminalDevices.Add(link.Get(0))
+        switchDevices.Add(link.Get(1))
+
+    # Create the bridge netdevice, which will do the packet switching
+    switchNode = csmaSwitch.Get(0)
+    bridgeDevice = ns3.BridgeNetDevice()
+    switchNode.AddDevice(bridgeDevice)
+
+    for portIter in range(switchDevices.GetN()):
+        bridgeDevice.AddBridgePort(switchDevices.Get(portIter))
+
+    # Add internet stack to the terminals
+    internet = ns3.InternetStackHelper()
+    internet.Install(terminals)
+
+    # We've got the "hardware" in place.  Now we need to add IP addresses.
+    #
+    print "Assign IP Addresses."
+    ipv4 = ns3.Ipv4AddressHelper()
+    ipv4.SetBase(ns3.Ipv4Address("10.1.1.0"), ns3.Ipv4Mask("255.255.255.0"))
+    ipv4.Assign(terminalDevices)
+
+    #
+    # Create an OnOff application to send UDP datagrams from node zero to node 1.
+    #
+    print "Create Applications."
+    port = 9   # Discard port(RFC 863)
+
+    onoff = ns3.OnOffHelper("ns3::UdpSocketFactory", 
+                            ns3.Address(ns3.InetSocketAddress(ns3.Ipv4Address("10.1.1.2"), port)))
+    onoff.SetAttribute("OnTime", ns3.RandomVariableValue(ns3.ConstantVariable(1)))
+    onoff.SetAttribute("OffTime", ns3.RandomVariableValue(ns3.ConstantVariable(0)))
+
+    app = onoff.Install(ns3.NodeContainer(terminals.Get(0)))
+    # Start the application
+    app.Start(ns3.Seconds(1.0))
+    app.Stop(ns3.Seconds(10.0))
+
+    # Create an optional packet sink to receive these packets
+    sink = ns3.PacketSinkHelper("ns3::UdpSocketFactory",
+                                ns3.Address(ns3.InetSocketAddress(ns3.Ipv4Address.GetAny(), port)))
+    sink.Install(ns3.NodeContainer(terminals.Get(1)))
+
+    # 
+    # Create a similar flow from n3 to n0, starting at time 1.1 seconds
+    #
+    onoff.SetAttribute("Remote", 
+                       ns3.AddressValue(ns3.InetSocketAddress(ns3.Ipv4Address("10.1.1.1"), port)))
+    app2 = onoff.Install(ns3.NodeContainer(terminals.Get(3)))
+
+    sink.Install(ns3.NodeContainer(terminals.Get(0)))
+
+    app2.Start(ns3.Seconds(1.1))
+    app2.Stop(ns3.Seconds(10.0))
+
+    #
+    # Configure tracing of all enqueue, dequeue, and NetDevice receive events.
+    # Trace output will be sent to the file "csma-bridge.tr"
+    #
+    #print "Configure Tracing."
+    #std.ofstream ascii
+    #ascii.open("csma-bridge.tr")
+    #CsmaHelper.EnableAsciiAll(ascii)
+
+    #
+    # Also configure some tcpdump traces; each interface will be traced.
+    # The output files will be named:
+    #     csma-bridge.pcap-<nodeId>-<interfaceId>
+    # and can be read by the "tcpdump -r" command(use "-tt" option to
+    # display timestamps correctly)
+    #
+    ns3.CsmaHelper.EnablePcapAll("csma-bridge")
+
+    #
+    # Now, do the actual simulation.
+    #
+    print "Run Simulation."
+    ns3.Simulator.Run()
+    ns3.Simulator.Destroy()
+    print "Done."
+
+
+
+if __name__ == '__main__':
+    import sys
+    main(sys.argv)
+
--- a/examples/wscript	Wed Jul 16 10:46:51 2008 +0100
+++ b/examples/wscript	Wed Jul 16 14:33:44 2008 +0100
@@ -24,6 +24,10 @@
         ['csma', 'internet-stack'])
     obj.source = 'csma-one-subnet.cc'
 
+    obj = bld.create_ns3_program('csma-bridge',
+        ['bridge', 'csma', 'internet-stack'])
+    obj.source = 'csma-bridge.cc'
+
     obj = bld.create_ns3_program('udp-echo',
         ['csma', 'internet-stack'])
     obj.source = 'udp-echo.cc'
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/devices/bridge/bridge-channel.cc	Wed Jul 16 14:33:44 2008 +0100
@@ -0,0 +1,83 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation;
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * Author: Gustavo Carneiro  <gjc@inescporto.pt>
+ */
+
+#include "ns3/log.h"
+#include "bridge-channel.h"
+
+NS_LOG_COMPONENT_DEFINE ("BridgeChannel");
+
+namespace ns3 {
+
+NS_OBJECT_ENSURE_REGISTERED (BridgeChannel);
+
+TypeId 
+BridgeChannel::GetTypeId (void)
+{
+  static TypeId tid = TypeId ("ns3::BridgeChannel")
+    .SetParent<Channel> ();
+  return tid;
+}
+
+BridgeChannel::BridgeChannel ()
+  : Channel ("BridgeChannel")
+{
+  NS_LOG_FUNCTION_NOARGS ();
+}
+
+BridgeChannel::~BridgeChannel ()
+{
+  NS_LOG_FUNCTION_NOARGS ();
+}
+
+void
+BridgeChannel::AddChannel (Ptr<Channel> bridgedChannel)
+{
+  m_bridgedChannels.push_back (bridgedChannel);
+}
+
+uint32_t
+BridgeChannel::GetNDevices (void) const
+{
+  uint32_t ndevices = 0;
+  for (std::vector< Ptr<Channel> >::const_iterator iter = m_bridgedChannels.begin ();
+       iter != m_bridgedChannels.end (); iter++)
+    {
+      ndevices += (*iter)->GetNDevices ();
+    }
+  return ndevices;
+}
+
+
+Ptr<NetDevice>
+BridgeChannel::GetDevice (uint32_t i) const
+{
+  uint32_t ndevices = 0;
+  for (std::vector< Ptr<Channel> >::const_iterator iter = m_bridgedChannels.begin ();
+       iter != m_bridgedChannels.end (); iter++)
+    {
+      if ((i - ndevices) < (*iter)->GetNDevices ())
+        {
+          return (*iter)->GetDevice (i - ndevices);
+        }
+      ndevices += (*iter)->GetNDevices ();
+    }
+  return NULL;
+}
+
+
+} // namespace ns3
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/devices/bridge/bridge-channel.h	Wed Jul 16 14:33:44 2008 +0100
@@ -0,0 +1,52 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation;
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * Author: Gustavo Carneiro  <gjc@inescporto.pt>
+ */
+#ifndef BRIDGE_CHANNEL_H
+#define BRIDGE_CHANNEL_H
+
+#include "ns3/net-device.h"
+#include "ns3/channel.h"
+#include <vector>
+
+namespace ns3 {
+
+/**
+ * \ingroup netdevice
+ * 
+ * \brief bridge net device for bridge things and testing
+ */
+class BridgeChannel : public Channel
+{
+public:
+  static TypeId GetTypeId (void);
+  BridgeChannel ();
+  virtual ~BridgeChannel ();
+
+  void AddChannel (Ptr<Channel> bridgedChannel);
+
+  // virtual methods implementation, from Channel
+  virtual uint32_t GetNDevices (void) const;
+  virtual Ptr<NetDevice> GetDevice (uint32_t i) const;
+
+private:
+  std::vector< Ptr<Channel> > m_bridgedChannels;
+
+};
+
+} // namespace ns3
+
+#endif /* BRIDGE_CHANNEL_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/devices/bridge/bridge-net-device.cc	Wed Jul 16 14:33:44 2008 +0100
@@ -0,0 +1,409 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation;
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * Author: Gustavo Carneiro  <gjc@inescporto.pt>
+ */
+#include "bridge-net-device.h"
+#include "ns3/node.h"
+#include "ns3/channel.h"
+#include "ns3/packet.h"
+#include "ns3/log.h"
+#include "ns3/boolean.h"
+#include "ns3/simulator.h"
+
+NS_LOG_COMPONENT_DEFINE ("BridgeNetDevice");
+
+namespace ns3 {
+
+
+TypeId
+BridgeNetDevice::GetTypeId (void)
+{
+  static TypeId tid = TypeId ("ns3::BridgeNetDevice")
+    .SetParent<NetDevice> ()
+    .AddConstructor<BridgeNetDevice> ()
+    .AddAttribute ("EnableLearning",
+                   "Enable the learning mode of the Learning Bridge",
+                   BooleanValue (true),
+                   MakeBooleanAccessor (&BridgeNetDevice::m_enableLearning),
+                   MakeBooleanChecker ())
+    .AddAttribute ("ExpirationTime",
+                   "Time it takes for learned MAC state entry to expire.",
+                   TimeValue (Seconds (30)),
+                   MakeTimeAccessor (&BridgeNetDevice::m_expirationTime),
+                   MakeTimeChecker ())
+    ;
+  return tid;
+}
+
+
+BridgeNetDevice::BridgeNetDevice ()
+  : m_node (0),
+    m_name (""),
+    m_ifIndex (0),
+    m_mtu (0xffff)
+{
+  m_channel = CreateObject<BridgeChannel> ();
+}
+
+void
+BridgeNetDevice::ReceiveFromDevice (Ptr<NetDevice> incomingPort, Ptr<Packet> packet, uint16_t protocol,
+                                    Address const &src, Address const &dst, PacketType packetType)
+{
+  NS_LOG_FUNCTION_NOARGS ();
+  NS_LOG_DEBUG ("UID is " << packet->GetUid ());
+
+  Mac48Address src48 = Mac48Address::ConvertFrom (src);
+  Mac48Address dst48 = Mac48Address::ConvertFrom (dst);
+
+
+  switch (packetType)
+    {
+    case PACKET_HOST:
+      if (dst48 == m_address)
+        {
+          m_rxCallback (this, packet, protocol, src, dst, packetType);
+        }
+      break;
+
+    case PACKET_BROADCAST:
+    case PACKET_MULTICAST:
+      m_rxCallback (this, packet, protocol, src, dst, packetType);
+      ForwardBroadcast (incomingPort, packet, protocol, src48, dst48);
+      break;
+
+    case PACKET_OTHERHOST:
+      ForwardUnicast (incomingPort, packet, protocol, src48, dst48);
+      break;
+    }
+}
+
+void
+BridgeNetDevice::ForwardUnicast (Ptr<NetDevice> incomingPort, Ptr<Packet> packet,
+                                 uint16_t protocol, Mac48Address src, Mac48Address dst)
+{
+  NS_LOG_DEBUG ("LearningBridgeForward (incomingPort=" << incomingPort->GetName ()
+                << ", packet=" << packet << ", protocol="<<protocol
+                << ", src=" << src << ", dst=" << dst << ")");
+
+  Learn (src, incomingPort);
+  Ptr<NetDevice> outPort = GetLearnedState (dst);
+  if (outPort != NULL && outPort != incomingPort)
+    {
+      NS_LOG_LOGIC ("Learning bridge state says to use port `" << outPort->GetName () << "'");
+      outPort->SendFrom (packet->Copy (), src, dst, protocol);
+    }
+  else
+    {
+      NS_LOG_LOGIC ("No learned state: send through all ports");
+      for (std::vector< Ptr<NetDevice> >::iterator iter = m_ports.begin ();
+           iter != m_ports.end (); iter++)
+        {
+          Ptr<NetDevice> port = *iter;
+          if (port != incomingPort)
+            {
+              NS_LOG_LOGIC ("LearningBridgeForward (" << src << " => " << dst << "): " << incomingPort->GetName ()
+                            << " --> " << port->GetName ()
+                            << " (UID " << packet->GetUid () << ").");
+              port->SendFrom (packet->Copy (), src, dst, protocol);
+            }
+        }
+    }
+}
+
+void
+BridgeNetDevice::ForwardBroadcast (Ptr<NetDevice> incomingPort, Ptr<Packet> packet,
+                                        uint16_t protocol, Mac48Address src, Mac48Address dst)
+{
+  NS_LOG_DEBUG ("LearningBridgeForward (incomingPort=" << incomingPort->GetName ()
+                << ", packet=" << packet << ", protocol="<<protocol
+                << ", src=" << src << ", dst=" << dst << ")");
+  Learn (src, incomingPort);
+
+  for (std::vector< Ptr<NetDevice> >::iterator iter = m_ports.begin ();
+         iter != m_ports.end (); iter++)
+    {
+      Ptr<NetDevice> port = *iter;
+      if (port != incomingPort)
+        {
+          NS_LOG_LOGIC ("LearningBridgeForward (" << src << " => " << dst << "): " << incomingPort->GetName ()
+                        << " --> " << port->GetName ()
+                        << " (UID " << packet->GetUid () << ").");
+          port->SendFrom (packet->Copy (), src, dst, protocol);
+        }
+    }
+}
+
+void BridgeNetDevice::Learn (Mac48Address source, Ptr<NetDevice> port)
+{
+  if (m_enableLearning)
+    {
+      LearnedState &state = m_learnState[source];
+      state.associatedPort = port;
+      state.expirationTime = Simulator::Now () + m_expirationTime;
+    }
+}
+
+Ptr<NetDevice> BridgeNetDevice::GetLearnedState (Mac48Address source)
+{
+  if (m_enableLearning)
+    {
+      std::map<Mac48Address, LearnedState>::iterator iter =
+        m_learnState.find (source);
+      if (iter != m_learnState.end ())
+        {
+          LearnedState &state = iter->second;
+          if (state.expirationTime > Simulator::Now ())
+            {
+              return state.associatedPort;
+            }
+          else
+            {
+              m_learnState.erase (iter);
+            }
+        }
+    }
+  return NULL;
+}
+
+void 
+BridgeNetDevice::AddBridgePort (Ptr<NetDevice> bridgePort)
+{
+  NS_ASSERT (bridgePort != this);
+  if (m_address == Mac48Address ())
+    {
+      m_address = Mac48Address::ConvertFrom (bridgePort->GetAddress ());
+    }
+
+  m_node->RegisterProtocolHandler (MakeCallback (&BridgeNetDevice::ReceiveFromDevice, this),
+                                   0, bridgePort);
+  m_ports.push_back (bridgePort);
+  m_channel->AddChannel (bridgePort->GetChannel ());
+}
+
+void 
+BridgeNetDevice::SetName(const std::string name)
+{
+  m_name = name;
+}
+
+std::string 
+BridgeNetDevice::GetName(void) const
+{
+  return m_name;
+}
+
+void 
+BridgeNetDevice::SetIfIndex(const uint32_t index)
+{
+  m_ifIndex = index;
+}
+
+uint32_t 
+BridgeNetDevice::GetIfIndex(void) const
+{
+  return m_ifIndex;
+}
+
+Ptr<Channel> 
+BridgeNetDevice::GetChannel (void) const
+{
+  return m_channel;
+}
+
+Address 
+BridgeNetDevice::GetAddress (void) const
+{
+  return m_address;
+}
+
+bool 
+BridgeNetDevice::SetMtu (const uint16_t mtu)
+{
+  m_mtu = mtu;
+  return true;
+}
+
+uint16_t 
+BridgeNetDevice::GetMtu (void) const
+{
+  return m_mtu;
+}
+
+
+bool 
+BridgeNetDevice::IsLinkUp (void) const
+{
+  return true;
+}
+
+
+void 
+BridgeNetDevice::SetLinkChangeCallback (Callback<void> callback)
+{}
+
+
+bool 
+BridgeNetDevice::IsBroadcast (void) const
+{
+  return true;
+}
+
+
+Address
+BridgeNetDevice::GetBroadcast (void) const
+{
+  return Mac48Address ("ff:ff:ff:ff:ff:ff");
+}
+
+bool
+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
+{
+ NS_LOG_FUNCTION (this << multicastGroup);
+//
+// First, get the generic multicast address.
+//
+  Address hardwareDestination = GetMulticast ();
+
+  NS_LOG_LOGIC ("Device multicast address: " << hardwareDestination);
+//
+// It's our address, and we know we're playing with an EUI-48 address here
+// primarily since we know that by construction, but also since the parameter
+// is an Ipv4Address.
+//
+  Mac48Address etherAddr = Mac48Address::ConvertFrom (hardwareDestination);
+//
+// We now have the multicast address in an abstract 48-bit container.  We 
+// need to pull it out so we can play with it.  When we're done, we have the 
+// high order bits in etherBuffer[0], etc.
+//
+  uint8_t etherBuffer[6];
+  etherAddr.CopyTo (etherBuffer);
+//
+// Now we need to pull the raw bits out of the Ipv4 destination address.
+//
+  uint8_t ipBuffer[4];
+  multicastGroup.Serialize (ipBuffer);
+//
+// RFC 1112 says that an Ipv4 host group address is mapped to an EUI-48
+// 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). 
+//
+  etherBuffer[3] |= ipBuffer[1] & 0x7f;
+  etherBuffer[4] = ipBuffer[2];
+  etherBuffer[5] = ipBuffer[3];
+//
+// Now, etherBuffer has the desired ethernet multicast address.  We have to
+// suck these bits back into the Mac48Address,
+//
+  etherAddr.CopyFrom (etherBuffer);
+//
+// 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 " << etherAddr);
+
+  return etherAddr;
+}
+
+
+bool 
+BridgeNetDevice::IsPointToPoint (void) const
+{
+  return false;
+}
+
+
+bool 
+BridgeNetDevice::Send (Ptr<Packet> packet, const Address& dest, uint16_t protocolNumber)
+{
+  for (std::vector< Ptr<NetDevice> >::iterator iter = m_ports.begin ();
+         iter != m_ports.end (); iter++)
+    {
+      Ptr<NetDevice> port = *iter;
+      port->SendFrom (packet, m_address, dest, protocolNumber);
+    }
+
+  return true;
+}
+
+bool 
+BridgeNetDevice::SendFrom (Ptr<Packet> packet, const Address& src, const Address& dest, uint16_t protocolNumber)
+{
+  for (std::vector< Ptr<NetDevice> >::iterator iter = m_ports.begin ();
+         iter != m_ports.end (); iter++)
+    {
+      Ptr<NetDevice> port = *iter;
+      port->SendFrom (packet, src, dest, protocolNumber);
+    }
+
+  return true;
+}
+
+
+Ptr<Node> 
+BridgeNetDevice::GetNode (void) const
+{
+  return m_node;
+}
+
+
+void 
+BridgeNetDevice::SetNode (Ptr<Node> node)
+{
+  m_node = node;
+}
+
+
+bool 
+BridgeNetDevice::NeedsArp (void) const
+{
+  return true;
+}
+
+
+void 
+BridgeNetDevice::SetReceiveCallback (NetDevice::ReceiveCallback cb)
+{
+  m_rxCallback = cb;
+}
+
+
+void
+BridgeNetDevice::DoDispose (void)
+{
+  m_node = 0;
+  NetDevice::DoDispose ();
+}
+
+
+
+} // namespace ns3
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/devices/bridge/bridge-net-device.h	Wed Jul 16 14:33:44 2008 +0100
@@ -0,0 +1,104 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation;
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * Author: Gustavo Carneiro  <gjc@inescporto.pt>
+ */
+#ifndef BRIDGE_NET_DEVICE_H
+#define BRIDGE_NET_DEVICE_H
+
+#include "ns3/net-device.h"
+#include "ns3/mac48-address.h"
+#include "ns3/nstime.h"
+#include "ns3/bridge-channel.h"
+#include <stdint.h>
+#include <string>
+#include <map>
+
+namespace ns3 {
+
+class Node;
+
+/**
+ * \ingroup netdevice
+ * 
+ * \brief bridge net device for bridge things and testing
+ */
+class BridgeNetDevice : public NetDevice
+{
+public:
+  static TypeId GetTypeId (void);
+  BridgeNetDevice ();
+
+  void AddBridgePort (Ptr<NetDevice> bridgePort);
+
+  // inherited from NetDevice base class.
+  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<Channel> 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<void> callback);
+  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 bool IsPointToPoint (void) const;
+  virtual bool Send (Ptr<Packet> packet, const Address& dest, uint16_t protocolNumber);
+  virtual bool SendFrom (Ptr<Packet> packet, const Address& source, const Address& dest, uint16_t protocolNumber);
+  virtual Ptr<Node> GetNode (void) const;
+  virtual void SetNode (Ptr<Node> node);
+  virtual bool NeedsArp (void) const;
+  virtual void SetReceiveCallback (NetDevice::ReceiveCallback cb);
+
+protected:
+  virtual void DoDispose (void);
+
+  void ReceiveFromDevice (Ptr<NetDevice> device, Ptr<Packet> packet, uint16_t protocol,
+                          Address const &source, Address const &destination, PacketType packetType);
+  void ForwardUnicast (Ptr<NetDevice> incomingPort, Ptr<Packet> packet,
+                       uint16_t protocol, Mac48Address src, Mac48Address dst);
+  void ForwardBroadcast (Ptr<NetDevice> incomingPort, Ptr<Packet> packet,
+                         uint16_t protocol, Mac48Address src, Mac48Address dst);
+  void Learn (Mac48Address source, Ptr<NetDevice> port);
+  Ptr<NetDevice> GetLearnedState (Mac48Address source);
+
+private:
+  NetDevice::ReceiveCallback m_rxCallback;
+
+  Mac48Address m_address;
+  Time m_expirationTime; // time it takes for learned MAC state to expire
+  struct LearnedState
+  {
+    Ptr<NetDevice> associatedPort;
+    Time expirationTime;
+  };
+  std::map<Mac48Address, LearnedState> m_learnState;
+  Ptr<Node> m_node;
+  Ptr<BridgeChannel> m_channel;
+  std::string m_name;
+  std::vector< Ptr<NetDevice> > m_ports;
+  uint32_t m_ifIndex;
+  uint16_t m_mtu;
+  bool m_enableLearning;
+};
+
+} // namespace ns3
+
+#endif /* BRIDGE_NET_DEVICE_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/devices/bridge/waf	Wed Jul 16 14:33:44 2008 +0100
@@ -0,0 +1,1 @@
+exec "`dirname "$0"`"/../../../waf "$@"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/devices/bridge/wscript	Wed Jul 16 14:33:44 2008 +0100
@@ -0,0 +1,14 @@
+## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
+
+def build(bld):
+    obj = bld.create_ns3_module('bridge', ['node'])
+    obj.source = [
+        'bridge-net-device.cc',
+        'bridge-channel.cc',
+        ]
+    headers = bld.create_obj('ns3header')
+    headers.module = 'bridge'
+    headers.source = [
+        'bridge-net-device.h',
+        'bridge-channel.h',
+        ]
--- a/src/devices/csma/csma-channel.cc	Wed Jul 16 10:46:51 2008 +0100
+++ b/src/devices/csma/csma-channel.cc	Wed Jul 16 14:33:44 2008 +0100
@@ -232,12 +232,14 @@
   NS_LOG_LOGIC ("Receive");
   
   std::vector<CsmaDeviceRec>::iterator it;
+  uint32_t devId = 0;
   for (it = m_deviceList.begin (); it < m_deviceList.end(); it++) 
     {
       if (it->IsActive ())
       {
-        it->devicePtr->Receive (m_currentPkt->Copy ());
+        it->devicePtr->Receive (m_currentPkt->Copy (), m_deviceList[m_currentSrc].devicePtr);
       }
+      devId++;
     }
   m_state = IDLE;
 }
--- a/src/devices/csma/csma-net-device.cc	Wed Jul 16 10:46:51 2008 +0100
+++ b/src/devices/csma/csma-net-device.cc	Wed Jul 16 14:33:44 2008 +0100
@@ -173,6 +173,7 @@
   void 
 CsmaNetDevice::AddHeader (
   Ptr<Packet> p, 
+  Mac48Address source,
   Mac48Address dest,
   uint16_t protocolNumber)
 {
@@ -183,7 +184,6 @@
       return;
     }
 
-  Mac48Address source = Mac48Address::ConvertFrom (GetAddress ());
   EthernetHeader header (false);
   header.SetSource (source);
   header.SetDestination (dest);
@@ -452,12 +452,23 @@
   m_receiveErrorModel = em; 
 }
 
-  void
-CsmaNetDevice::Receive (Ptr<Packet> packet)
+void
+CsmaNetDevice::Receive (Ptr<Packet> packet, Ptr<CsmaNetDevice> senderDevice)
 {
   NS_LOG_FUNCTION_NOARGS ();
   NS_LOG_LOGIC ("UID is " << packet->GetUid ());
 
+
+  //
+  // 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
+  // silently (no tracing) since it would really never get here in a real device.
+  // 
+  if (senderDevice == this)
+    {
+      return;
+    }
+
 // 
 // Only receive if the send side of net device is enabled
 //
@@ -470,7 +481,7 @@
   if (m_encapMode == RAW)
     {
       m_rxTrace (packet);
-      m_rxCallback (this, packet, 0, GetBroadcast ());
+      m_rxCallback (this, packet, 0, GetBroadcast (), GetAddress (), PACKET_HOST);
       return;
     }
 
@@ -491,17 +502,6 @@
   NS_LOG_LOGIC ("Pkt destination is " << header.GetDestination ());
 
 //
-// 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 
-// silently (no tracing) since it would really never get here in a real device.
-//
-  if (header.GetSource () == GetAddress ())
-    {
-      NS_LOG_LOGIC ("Ignoring packet sourced by this device");
-      return;
-    }
-
-//
 // An IP 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).
@@ -522,15 +522,6 @@
   Mac48Address broadcast = Mac48Address::ConvertFrom (GetBroadcast ());
   Mac48Address destination = Mac48Address::ConvertFrom (GetAddress ());
 
-  if ((header.GetDestination () != broadcast) &&
-      (mcDest != multicast) &&
-      (header.GetDestination () != destination))
-    {
-      NS_LOG_LOGIC ("Dropping pkt ");
-      m_dropTrace (packet);
-      return;
-    }
-
   if (m_receiveErrorModel && m_receiveErrorModel->IsCorrupt (packet) )
     {
       NS_LOG_LOGIC ("Dropping pkt due to error model ");
@@ -561,8 +552,30 @@
           NS_ASSERT (false);
           break;
         }
-      m_rxTrace (originalPacket);
-      m_rxCallback (this, packet, protocol, header.GetSource ());
+
+      PacketType packetType;
+      
+      if (header.GetDestination () == broadcast)
+        {
+          packetType = PACKET_BROADCAST;
+          m_rxTrace (originalPacket);
+        }
+      else if (mcDest == multicast)
+        {
+          packetType = PACKET_MULTICAST;          
+          m_rxTrace (originalPacket);
+        }
+      else if (header.GetDestination () == destination)
+        {
+          packetType = PACKET_HOST;
+          m_rxTrace (originalPacket);
+        }
+      else
+        {
+          packetType = PACKET_OTHERHOST;
+        }
+      
+      m_rxCallback (this, packet, protocol, header.GetSource (), header.GetDestination (), packetType);
     }
 }
 
@@ -726,11 +739,19 @@
   return false;
 }
 
-  bool 
-CsmaNetDevice::Send(
-  Ptr<Packet> packet, 
-  const Address& dest, 
-  uint16_t protocolNumber)
+bool
+CsmaNetDevice::Send (Ptr<Packet> packet, 
+                     const Address& dest, 
+                     uint16_t protocolNumber)
+{
+  return SendFrom (packet, m_address, dest, protocolNumber);
+}
+
+bool
+CsmaNetDevice::SendFrom (Ptr<Packet> packet,
+                         const Address& src,
+                         const Address& dest,
+                         uint16_t protocolNumber)
 {
   NS_LOG_FUNCTION_NOARGS ();
   NS_LOG_LOGIC ("p=" << packet);
@@ -747,7 +768,8 @@
     }
 
   Mac48Address destination = Mac48Address::ConvertFrom (dest);
-  AddHeader (packet, destination, protocolNumber);
+  Mac48Address source = Mac48Address::ConvertFrom (src);
+  AddHeader (packet, source, destination, protocolNumber);
 
 //
 // Place the packet to be sent on the send queue
@@ -785,6 +807,25 @@
 CsmaNetDevice::SetNode (Ptr<Node> node)
 {
   m_node = node;
+  int count = -1;
+  if (m_name.size () == 0)
+    {
+      for (uint32_t i = 0; i < node->GetNDevices (); i++)
+        {
+          Ptr<NetDevice> dev = node->GetDevice (i);
+          if (dynamic_cast<CsmaNetDevice*> (PeekPointer (dev)))
+            {
+              count++;
+              if (dev == this)
+                {
+                  break;
+                }
+            }
+        }
+      std::ostringstream s;
+      s << "eth" << count;
+      m_name = s.str ();
+    }
 }
 
   bool 
--- a/src/devices/csma/csma-net-device.h	Wed Jul 16 10:46:51 2008 +0100
+++ b/src/devices/csma/csma-net-device.h	Wed Jul 16 14:33:44 2008 +0100
@@ -158,8 +158,9 @@
    *
    * @see CsmaChannel
    * \param p a reference to the received packet
+   * \param sender the CsmaNetDevice that transmitted the packet in the first place
    */
-  void Receive (Ptr<Packet> p);
+  void Receive (Ptr<Packet> p, Ptr<CsmaNetDevice> sender);
 
   /**
    * Is the send side of the network device enabled?
@@ -251,6 +252,12 @@
     uint16_t protocolNumber);
 
   /**
+   * Start sending a packet down the channel, with MAC spoofing
+   */
+  virtual bool SendFrom (Ptr<Packet> packet, const Address& source, const Address& dest, 
+                         uint16_t protocolNumber);
+
+  /**
    * Get the node to which this device is attached.
    *
    * \returns Ptr to the Node to which the device is attached.
@@ -306,7 +313,7 @@
    * \param protocolNumber In some protocols, identifies the type of
    * payload contained in this packet.
    */
-  void AddHeader (Ptr<Packet> p, Mac48Address dest, uint16_t protocolNumber);
+  void AddHeader (Ptr<Packet> p, Mac48Address source, Mac48Address dest, uint16_t protocolNumber);
 
   /**
    * Removes, from a packet of data, all headers and trailers that
--- a/src/devices/point-to-point/point-to-point-net-device.cc	Wed Jul 16 10:46:51 2008 +0100
+++ b/src/devices/point-to-point/point-to-point-net-device.cc	Wed Jul 16 14:33:44 2008 +0100
@@ -241,7 +241,7 @@
 //
       m_rxTrace (packet);
       ProcessHeader(packet, protocol);
-      m_rxCallback (this, packet, protocol, GetBroadcast ());
+      m_rxCallback (this, packet, protocol, GetBroadcast (), m_address, PACKET_HOST);
     }
 }
 
@@ -434,6 +434,15 @@
     }
 }
 
+bool
+PointToPointNetDevice::SendFrom (Ptr<Packet> packet, 
+                                 const Address &source, 
+                                 const Address &dest, 
+                                 uint16_t protocolNumber)
+{
+  return Send (packet, dest, protocolNumber);
+}
+
   Ptr<Node> 
 PointToPointNetDevice::GetNode (void) const
 {
--- a/src/devices/point-to-point/point-to-point-net-device.h	Wed Jul 16 10:46:51 2008 +0100
+++ b/src/devices/point-to-point/point-to-point-net-device.h	Wed Jul 16 14:33:44 2008 +0100
@@ -167,8 +167,8 @@
 
   virtual bool IsPointToPoint (void) const;
 
-  virtual bool Send(Ptr<Packet> packet, const Address &dest, 
-    uint16_t protocolNumber);
+  virtual bool Send(Ptr<Packet> packet, const Address &dest, uint16_t protocolNumber);
+  virtual bool SendFrom(Ptr<Packet> packet, const Address& source, const Address& dest, uint16_t protocolNumber);
 
   virtual Ptr<Node> GetNode (void) const;
   virtual void SetNode (Ptr<Node> node);
--- a/src/devices/wifi/wifi-net-device.cc	Wed Jul 16 10:46:51 2008 +0100
+++ b/src/devices/wifi/wifi-net-device.cc	Wed Jul 16 14:33:44 2008 +0100
@@ -283,6 +283,12 @@
   m_mac->Enqueue (packet, realTo);
   return true;
 }
+bool 
+WifiNetDevice::SendFrom (Ptr<Packet> packet, const Address& source, const Address& dest, uint16_t protocolNumber)
+{
+  NS_FATAL_ERROR ("WifiNetDevice::SendFrom not implemented.");
+  return false;
+}
 Ptr<Node> 
 WifiNetDevice::GetNode (void) const
 {
@@ -310,7 +316,9 @@
   m_rxLogger (packet, from);
   LlcSnapHeader llc;
   packet->RemoveHeader (llc);
-  m_forwardUp (this, packet, llc.GetType (), from);
+  Mac48Address to = from; // FIXME
+  PacketType packetType = PACKET_HOST; // FIXME
+  m_forwardUp (this, packet, llc.GetType (), from, to, packetType);
 }
 
 void
--- a/src/devices/wifi/wifi-net-device.h	Wed Jul 16 10:46:51 2008 +0100
+++ b/src/devices/wifi/wifi-net-device.h	Wed Jul 16 14:33:44 2008 +0100
@@ -96,6 +96,7 @@
   virtual Address MakeMulticastAddress (Ipv4Address multicastGroup) const;
   virtual bool IsPointToPoint (void) const;
   virtual bool Send(Ptr<Packet> packet, const Address& dest, uint16_t protocolNumber);
+  virtual bool SendFrom (Ptr<Packet> packet, const Address& src, const Address& dest, uint16_t protocolNumber);
   virtual Ptr<Node> GetNode (void) const;
   virtual void SetNode (Ptr<Node> node);
   virtual bool NeedsArp (void) const;
@@ -113,7 +114,7 @@
   Ptr<WifiChannel> m_channel;
   Ptr<WifiMac> m_mac;
   Ptr<WifiRemoteStationManager> m_stationManager;
-  Callback <bool,Ptr<NetDevice>,Ptr<Packet>,uint16_t,const Address &> m_forwardUp;
+  ReceiveCallback m_forwardUp;
   TracedCallback<Ptr<const Packet>, Mac48Address> m_rxLogger;
   TracedCallback<Ptr<const Packet>, Mac48Address> m_txLogger;
   uint32_t m_ifIndex;
--- a/src/internet-stack/arp-l3-protocol.cc	Wed Jul 16 10:46:51 2008 +0100
+++ b/src/internet-stack/arp-l3-protocol.cc	Wed Jul 16 14:33:44 2008 +0100
@@ -114,9 +114,16 @@
 }
 
 void 
-ArpL3Protocol::Receive(Ptr<NetDevice> device, Ptr<Packet> packet, uint16_t protocol, const Address &from)
+ArpL3Protocol::Receive(Ptr<NetDevice> device, Ptr<Packet> packet, uint16_t protocol, const Address &from,
+                       const Address &to, NetDevice::PacketType packetType)
 {
   NS_LOG_FUNCTION_NOARGS ();
+
+  if (packetType == NetDevice::PACKET_OTHERHOST)
+    {
+      return;
+    }
+
   Ptr<ArpCache> cache = FindCache (device);
   ArpHeader arp;
   packet->RemoveHeader (arp);
--- a/src/internet-stack/arp-l3-protocol.h	Wed Jul 16 10:46:51 2008 +0100
+++ b/src/internet-stack/arp-l3-protocol.h	Wed Jul 16 14:33:44 2008 +0100
@@ -54,7 +54,8 @@
   /**
    * \brief Recieve a packet
    */
-  void Receive(Ptr<NetDevice> device, Ptr<Packet> p, uint16_t protocol, const Address &from);
+  void Receive(Ptr<NetDevice> device, Ptr<Packet> p, uint16_t protocol, const Address &from, const Address &to,
+               NetDevice::PacketType packetType);
   /**
    * \brief Perform an ARP lookup
    * \param p
--- a/src/internet-stack/ipv4-l3-protocol.cc	Wed Jul 16 10:46:51 2008 +0100
+++ b/src/internet-stack/ipv4-l3-protocol.cc	Wed Jul 16 14:33:44 2008 +0100
@@ -449,10 +449,16 @@
 }  
 
 void 
-Ipv4L3Protocol::Receive( Ptr<NetDevice> device, Ptr<Packet> packet, uint16_t protocol, const Address &from)
+Ipv4L3Protocol::Receive( Ptr<NetDevice> device, Ptr<Packet> packet, uint16_t protocol, const Address &from,
+                         const Address &to, NetDevice::PacketType packetType)
 {
   NS_LOG_FUNCTION (this << &device << packet << protocol <<  from);
 
+  if (packetType == NetDevice::PACKET_OTHERHOST)
+    {
+      return;
+    }
+
   NS_LOG_LOGIC ("Packet from " << from << " received on node " << m_node->GetId ());
 
   uint32_t index = 0;
--- a/src/internet-stack/ipv4-l3-protocol.h	Wed Jul 16 10:46:51 2008 +0100
+++ b/src/internet-stack/ipv4-l3-protocol.h	Wed Jul 16 14:33:44 2008 +0100
@@ -25,6 +25,7 @@
 #include <stdint.h>
 #include "ns3/ipv4-address.h"
 #include "ns3/ptr.h"
+#include "ns3/net-device.h"
 #include "ns3/ipv4.h"
 #include "ns3/traced-callback.h"
 #include "ns3/ipv4-header.h"
@@ -82,7 +83,8 @@
    *    - implement a per-NetDevice ARP cache
    *    - send back arp replies on the right device
    */
-  void Receive( Ptr<NetDevice> device, Ptr<Packet> p, uint16_t protocol, const Address &from);
+  void Receive( Ptr<NetDevice> device, Ptr<Packet> p, uint16_t protocol, const Address &from,
+                const Address &to, NetDevice::PacketType packetType);
 
   /**
    * \param packet packet to send
--- a/src/internet-stack/ipv4-loopback-interface.cc	Wed Jul 16 10:46:51 2008 +0100
+++ b/src/internet-stack/ipv4-loopback-interface.cc	Wed Jul 16 14:33:44 2008 +0100
@@ -73,7 +73,10 @@
     m_node->GetObject<Ipv4L3Protocol> ();
 
   ipv4->Receive (0, packet, Ipv4L3Protocol::PROT_NUMBER, 
-                 Mac48Address ("ff:ff:ff:ff:ff:ff"));
+                 Mac48Address ("ff:ff:ff:ff:ff:ff"),
+                 Mac48Address ("ff:ff:ff:ff:ff:ff"),
+                 NetDevice::PACKET_HOST // note: linux uses PACKET_LOOPBACK here
+                 );
 }
 
 }//namespace ns3
--- a/src/node/net-device.h	Wed Jul 16 10:46:51 2008 +0100
+++ b/src/node/net-device.h	Wed Jul 16 14:33:44 2008 +0100
@@ -216,6 +216,20 @@
    */
   virtual bool Send(Ptr<Packet> packet, const Address& dest, uint16_t protocolNumber) = 0;
   /**
+   * \param packet packet sent from above down to Network Device
+   * \param source source mac address (so called "MAC spoofing")
+   * \param dest mac address of the destination (already resolved)
+   * \param protocolNumber identifies the type of payload contained in
+   *        this packet. Used to call the right L3Protocol when the packet
+   *        is received.
+   * 
+   *  Called from higher layer to send packet into Network Device
+   *  with the specified source and destination Addresses.
+   * 
+   * \return whether the Send operation succeeded 
+   */
+  virtual bool SendFrom(Ptr<Packet> packet, const Address& source, const Address& dest, uint16_t protocolNumber) = 0;
+  /**
    * \returns the node base class which contains this network
    *          interface.
    *
@@ -240,17 +254,28 @@
    */
   virtual bool NeedsArp (void) const = 0;
 
+
+  /** Packet types */
+  enum PacketType
+    {
+      PACKET_HOST = 1,  /* To us                */
+      PACKET_BROADCAST, /* To all               */
+      PACKET_MULTICAST, /* To group             */
+      PACKET_OTHERHOST, /* To someone else      */
+    };
+
   /**
    * \param device a pointer to the net device which is calling this callback
    * \param packet the packet received
    * \param protocol the 16 bit protocol number associated with this packet.
    *        This protocol number is expected to be the same protocol number
    *        given to the Send method by the user on the sender side.
-   * \param address the address of the sender
+   * \param sender the address of the sender
+   * \param receiver the address of the receiver
    * \returns true if the callback could handle the packet successfully, false
    *          otherwise.
    */
-  typedef Callback<bool,Ptr<NetDevice>,Ptr<Packet>,uint16_t,const Address &> ReceiveCallback;
+  typedef Callback<bool,Ptr<NetDevice>,Ptr<Packet>,uint16_t,const Address &,const Address &, PacketType> ReceiveCallback;
 
   /**
    * \param cb callback to invoke whenever a packet has been received and must
--- a/src/node/node.cc	Wed Jul 16 10:46:51 2008 +0100
+++ b/src/node/node.cc	Wed Jul 16 14:33:44 2008 +0100
@@ -194,8 +194,8 @@
 }
 
 bool
-Node::ReceiveFromDevice (Ptr<NetDevice> device, Ptr<Packet> packet, 
-                         uint16_t protocol, const Address &from)
+Node::ReceiveFromDevice (Ptr<NetDevice> device, Ptr<Packet> packet, uint16_t protocol,
+                         const Address &from, const Address &to, NetDevice::PacketType packetType)
 {
   bool found = false;
   // if there are (potentially) multiple handlers, we need to copy the
@@ -212,7 +212,7 @@
           if (i->protocol == 0 || 
               i->protocol == protocol)
             {
-              i->handler (device, (copyNeeded ? packet->Copy () : packet), protocol, from);
+              i->handler (device, (copyNeeded ? packet->Copy () : packet), protocol, from, to, packetType);
               found = true;
             }
         }
--- a/src/node/node.h	Wed Jul 16 10:46:51 2008 +0100
+++ b/src/node/node.h	Wed Jul 16 14:33:44 2008 +0100
@@ -26,10 +26,10 @@
 #include "ns3/object.h"
 #include "ns3/callback.h"
 #include "ns3/ptr.h"
+#include "ns3/net-device.h"
 
 namespace ns3 {
 
-class NetDevice;
 class Application;
 class Packet;
 class Address;
@@ -137,7 +137,8 @@
   /**
    * A protocol handler
    */
-  typedef Callback<void,Ptr<NetDevice>, Ptr<Packet>,uint16_t,const Address &> ProtocolHandler;
+  typedef Callback<void,Ptr<NetDevice>, Ptr<Packet>,uint16_t,const Address &,
+                   const Address &, NetDevice::PacketType> ProtocolHandler;
   /**
    * \param handler the handler to register
    * \param protocolType the type of protocol this handler is 
@@ -161,6 +162,35 @@
    */
   void UnregisterProtocolHandler (ProtocolHandler handler);
 
+  /**
+   * A promiscuous protocol handler
+   */
+  typedef Callback<void,Ptr<NetDevice>, Ptr<Packet>,uint16_t,
+                   const Address &, const Address &, bool> PromiscuousProtocolHandler;
+  /**
+   * \param handler the handler to register
+   * \param protocolType the type of protocol this handler is 
+   *        interested in. This protocol type is a so-called
+   *        EtherType, as registered here:
+   *        http://standards.ieee.org/regauth/ethertype/eth.txt
+   *        the value zero is interpreted as matching all
+   *        protocols.
+   * \param device the device attached to this handler. If the
+   *        value is zero, the handler is attached to all
+   *        devices on this node.
+   */
+  void RegisterPromiscuousProtocolHandler (PromiscuousProtocolHandler handler, 
+                                           uint16_t protocolType,
+                                           Ptr<NetDevice> device);
+  /**
+   * \param handler the handler to unregister
+   *
+   * After this call returns, the input handler will never
+   * be invoked anymore.
+   */
+  void UnregisterPromiscuousProtocolHandler (PromiscuousProtocolHandler handler);
+
+
 protected:
   /**
    * The dispose method. Subclasses must override this method
@@ -177,8 +207,8 @@
    */
   virtual void NotifyDeviceAdded (Ptr<NetDevice> device);
 
-  bool ReceiveFromDevice (Ptr<NetDevice> device, Ptr<Packet>, 
-                          uint16_t protocol, const Address &from);
+  bool ReceiveFromDevice (Ptr<NetDevice> device, Ptr<Packet>, uint16_t protocol,
+                          const Address &from, const Address &to, NetDevice::PacketType packetType);
   void Construct (void);
 
   struct ProtocolHandlerEntry {
@@ -192,6 +222,7 @@
   std::vector<Ptr<NetDevice> > m_devices;
   std::vector<Ptr<Application> > m_applications;
   ProtocolHandlerList m_handlers;
+
 };
 
 } //namespace ns3
--- a/src/node/packet-socket.cc	Wed Jul 16 10:46:51 2008 +0100
+++ b/src/node/packet-socket.cc	Wed Jul 16 14:33:44 2008 +0100
@@ -345,13 +345,19 @@
 
 void 
 PacketSocket::ForwardUp (Ptr<NetDevice> device, Ptr<Packet> packet, 
-                         uint16_t protocol, const Address &from)
+                         uint16_t protocol, const Address &from,
+                         const Address &to, NetDevice::PacketType packetType)
 {
   NS_LOG_FUNCTION_NOARGS ();
   if (m_shutdownRecv)
     {
       return;
     }
+  if (packetType != NetDevice::PACKET_HOST)
+    {
+      return;
+    }
+
 
   PacketSocketAddress address;
   address.SetPhysicalAddress (from);
--- a/src/node/packet-socket.h	Wed Jul 16 10:46:51 2008 +0100
+++ b/src/node/packet-socket.h	Wed Jul 16 14:33:44 2008 +0100
@@ -27,6 +27,7 @@
 #include "ns3/traced-callback.h"
 #include "ns3/ptr.h"
 #include "ns3/socket.h"
+#include "ns3/net-device.h"
 
 namespace ns3 {
 
@@ -103,7 +104,8 @@
 
 private:
   void ForwardUp (Ptr<NetDevice> device, Ptr<Packet> packet, 
-                  uint16_t protocol, const Address &from);
+                  uint16_t protocol, const Address &from, const Address &to,
+                  NetDevice::PacketType packetType);
   int DoBind (const PacketSocketAddress &address);
   uint32_t GetMinMtu (PacketSocketAddress ad) const;
   virtual void DoDispose (void);
--- a/src/node/simple-net-device.cc	Wed Jul 16 10:46:51 2008 +0100
+++ b/src/node/simple-net-device.cc	Wed Jul 16 14:33:44 2008 +0100
@@ -46,10 +46,20 @@
 SimpleNetDevice::Receive (Ptr<Packet> packet, uint16_t protocol, 
 			  Mac48Address to, Mac48Address from)
 {
-  if (to == m_address || to == Mac48Address::GetBroadcast ())
+  NetDevice::PacketType packetType;
+  if (to == m_address)
+    {
+      packetType = NetDevice::PACKET_HOST;
+    }
+  else if (to == Mac48Address::GetBroadcast ())
     {
-      m_rxCallback (this, packet, protocol, from);
+      packetType = NetDevice::PACKET_HOST;
     }
+  else
+    {
+      NS_FATAL_ERROR ("Weird packet destination " << to);
+    }
+  m_rxCallback (this, packet, protocol, from, to, packetType);
 }
 
 void 
@@ -151,6 +161,15 @@
   m_channel->Send (packet, protocolNumber, to, m_address, this);
   return true;
 }
+bool 
+SimpleNetDevice::SendFrom(Ptr<Packet> packet, const Address& source, const Address& dest, uint16_t protocolNumber)
+{
+  Mac48Address to = Mac48Address::ConvertFrom (dest);
+  Mac48Address from = Mac48Address::ConvertFrom (source);
+  m_channel->Send (packet, protocolNumber, to, from, this);
+  return true;
+}
+
 Ptr<Node> 
 SimpleNetDevice::GetNode (void) const
 {
--- a/src/node/simple-net-device.h	Wed Jul 16 10:46:51 2008 +0100
+++ b/src/node/simple-net-device.h	Wed Jul 16 14:33:44 2008 +0100
@@ -63,6 +63,7 @@
   virtual Address MakeMulticastAddress (Ipv4Address multicastGroup) const;
   virtual bool IsPointToPoint (void) const;
   virtual bool Send(Ptr<Packet> packet, const Address& dest, uint16_t protocolNumber);
+  virtual bool SendFrom(Ptr<Packet> packet, const Address& source, const Address& dest, uint16_t protocolNumber);
   virtual Ptr<Node> GetNode (void) const;
   virtual void SetNode (Ptr<Node> node);
   virtual bool NeedsArp (void) const;
--- a/src/wscript	Wed Jul 16 10:46:51 2008 +0100
+++ b/src/wscript	Wed Jul 16 14:33:44 2008 +0100
@@ -27,6 +27,7 @@
     'mobility',
     'devices/wifi',
     'helper',
+    'devices/bridge',
     )
 
 def set_options(opt):