Commit 8f7b4501 authored by Mathieu Lacage's avatar Mathieu Lacage
Browse files

bug 274: bridge must detect compatibility of devices with bridging mode

parent 5fd19292
No related merge requests found
Showing with 489 additions and 482 deletions
+489 -482
......@@ -182,8 +182,8 @@ def register_Ns3BridgeNetDevice_methods(root_module, cls):
'void',
[param('ns3::Callback< bool, ns3::Ptr< ns3::NetDevice >, ns3::Ptr< ns3::Packet const >, unsigned short, ns3::Address const&, ns3::Address const&, ns3::NetDevice::PacketType >', 'cb')],
is_virtual=True)
## bridge-net-device.h: bool ns3::BridgeNetDevice::SupportsPromiscuous() const [member function]
cls.add_method('SupportsPromiscuous',
## bridge-net-device.h: bool ns3::BridgeNetDevice::SupportsSendFrom() const [member function]
cls.add_method('SupportsSendFrom',
'bool',
[],
is_const=True, is_virtual=True)
......
......@@ -7,14 +7,14 @@ def register_types(module):
module.add_class('Gnuplot')
## event-garbage-collector.h: ns3::EventGarbageCollector [class]
module.add_class('EventGarbageCollector')
## gtk-config-store.h: ns3::GtkConfigStore [class]
module.add_class('GtkConfigStore')
## gnuplot.h: ns3::GnuplotDataset [class]
module.add_class('GnuplotDataset')
## gnuplot.h: ns3::GnuplotDataset::Style [enumeration]
module.add_enum('Style', ['LINES', 'POINTS', 'LINES_POINTS', 'DOTS', 'IMPULSES', 'STEPS', 'FSTEPS', 'HISTEPS'], outer_class=root_module['ns3::GnuplotDataset'])
## gnuplot.h: ns3::GnuplotDataset::ErrorBars [enumeration]
module.add_enum('ErrorBars', ['NONE', 'X', 'Y', 'XY'], outer_class=root_module['ns3::GnuplotDataset'])
## gtk-config-store.h: ns3::GtkConfigStore [class]
module.add_class('GtkConfigStore')
## config-store.h: ns3::ConfigStore [class]
module.add_class('ConfigStore', parent=root_module['ns3::ObjectBase'])
## delay-jitter-estimation.h: ns3::DelayJitterEstimation [class]
......@@ -63,8 +63,8 @@ def register_types_ns3_olsr(module):
def register_methods(root_module):
register_Ns3Gnuplot_methods(root_module, root_module['ns3::Gnuplot'])
register_Ns3EventGarbageCollector_methods(root_module, root_module['ns3::EventGarbageCollector'])
register_Ns3GnuplotDataset_methods(root_module, root_module['ns3::GnuplotDataset'])
register_Ns3GtkConfigStore_methods(root_module, root_module['ns3::GtkConfigStore'])
register_Ns3GnuplotDataset_methods(root_module, root_module['ns3::GnuplotDataset'])
register_Ns3ConfigStore_methods(root_module, root_module['ns3::ConfigStore'])
register_Ns3DelayJitterEstimation_methods(root_module, root_module['ns3::DelayJitterEstimation'])
return
......@@ -99,6 +99,17 @@ def register_Ns3EventGarbageCollector_methods(root_module, cls):
[param('ns3::EventId', 'event')])
return
def register_Ns3GtkConfigStore_methods(root_module, cls):
## gtk-config-store.h: ns3::GtkConfigStore::GtkConfigStore(ns3::GtkConfigStore const & arg0) [copy constructor]
cls.add_constructor([param('ns3::GtkConfigStore const &', 'arg0')])
## gtk-config-store.h: ns3::GtkConfigStore::GtkConfigStore() [constructor]
cls.add_constructor([])
## gtk-config-store.h: void ns3::GtkConfigStore::Configure() [member function]
cls.add_method('Configure',
'void',
[])
return
def register_Ns3GnuplotDataset_methods(root_module, cls):
## gnuplot.h: ns3::GnuplotDataset::GnuplotDataset(ns3::GnuplotDataset const & arg0) [copy constructor]
cls.add_constructor([param('ns3::GnuplotDataset const &', 'arg0')])
......@@ -124,17 +135,6 @@ def register_Ns3GnuplotDataset_methods(root_module, cls):
[param('double', 'x'), param('double', 'y'), param('double', 'errorDelta')])
return
def register_Ns3GtkConfigStore_methods(root_module, cls):
## gtk-config-store.h: ns3::GtkConfigStore::GtkConfigStore(ns3::GtkConfigStore const & arg0) [copy constructor]
cls.add_constructor([param('ns3::GtkConfigStore const &', 'arg0')])
## gtk-config-store.h: ns3::GtkConfigStore::GtkConfigStore() [constructor]
cls.add_constructor([])
## gtk-config-store.h: void ns3::GtkConfigStore::Configure() [member function]
cls.add_method('Configure',
'void',
[])
return
def register_Ns3ConfigStore_methods(root_module, cls):
## config-store.h: ns3::ConfigStore::ConfigStore(ns3::ConfigStore const & arg0) [copy constructor]
cls.add_constructor([param('ns3::ConfigStore const &', 'arg0')])
......
......@@ -397,8 +397,8 @@ def register_Ns3CsmaNetDevice_methods(root_module, cls):
'void',
[param('ns3::Callback< bool, ns3::Ptr< ns3::NetDevice >, ns3::Ptr< ns3::Packet const >, unsigned short, ns3::Address const&, ns3::Address const&, ns3::NetDevice::PacketType >', 'cb')],
is_virtual=True)
## csma-net-device.h: bool ns3::CsmaNetDevice::SupportsPromiscuous() const [member function]
cls.add_method('SupportsPromiscuous',
## csma-net-device.h: bool ns3::CsmaNetDevice::SupportsSendFrom() const [member function]
cls.add_method('SupportsSendFrom',
'bool',
[],
is_const=True, is_virtual=True)
......
......@@ -11,10 +11,10 @@ def register_types(module):
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', parent=root_module['ns3::Ipv4RoutingProtocol'])
## ipv4-l3-protocol.h: ns3::Ipv4L3Protocol [class]
module.add_class('Ipv4L3Protocol', parent=root_module['ns3::Object'])
## ipv4-static-routing.h: ns3::Ipv4StaticRouting [class]
module.add_class('Ipv4StaticRouting', parent=root_module['ns3::Ipv4RoutingProtocol'])
## Register a nested module for the namespace internal
......@@ -60,8 +60,8 @@ def register_methods(root_module):
register_Ns3Ipv4Interface_methods(root_module, root_module['ns3::Ipv4Interface'])
register_Ns3UdpHeader_methods(root_module, root_module['ns3::UdpHeader'])
register_Ns3TcpHeader_methods(root_module, root_module['ns3::TcpHeader'])
register_Ns3Ipv4StaticRouting_methods(root_module, root_module['ns3::Ipv4StaticRouting'])
register_Ns3Ipv4L3Protocol_methods(root_module, root_module['ns3::Ipv4L3Protocol'])
register_Ns3Ipv4StaticRouting_methods(root_module, root_module['ns3::Ipv4StaticRouting'])
return
def register_Ns3Ipv4Interface_methods(root_module, cls):
......@@ -340,95 +340,6 @@ def register_Ns3TcpHeader_methods(root_module, cls):
is_const=True)
return
def register_Ns3Ipv4StaticRouting_methods(root_module, cls):
## ipv4-static-routing.h: ns3::Ipv4StaticRouting::Ipv4StaticRouting(ns3::Ipv4StaticRouting const & arg0) [copy constructor]
cls.add_constructor([param('ns3::Ipv4StaticRouting const &', 'arg0')])
## ipv4-static-routing.h: ns3::Ipv4StaticRouting::Ipv4StaticRouting() [constructor]
cls.add_constructor([])
## ipv4-static-routing.h: bool ns3::Ipv4StaticRouting::RequestRoute(uint32_t ifIndex, ns3::Ipv4Header const & ipHeader, ns3::Ptr<ns3::Packet> packet, ns3::Callback<void,bool,const ns3::Ipv4Route&,ns3::Ptr<ns3::Packet>,const ns3::Ipv4Header&,ns3::empty,ns3::empty> routeReply) [member function]
cls.add_method('RequestRoute',
'bool',
[param('uint32_t', 'ifIndex'), param('ns3::Ipv4Header const &', 'ipHeader'), param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Callback< void, bool, const ns3::Ipv4Route&, ns3::Ptr< ns3::Packet >, const ns3::Ipv4Header&, ns3::empty, ns3::empty >', 'routeReply')],
is_virtual=True)
## ipv4-static-routing.h: bool ns3::Ipv4StaticRouting::RequestIfIndex(ns3::Ipv4Address destination, uint32_t & ifIndex) [member function]
cls.add_method('RequestIfIndex',
'bool',
[param('ns3::Ipv4Address', 'destination'), param('uint32_t &', 'ifIndex')],
is_virtual=True)
## ipv4-static-routing.h: void ns3::Ipv4StaticRouting::AddHostRouteTo(ns3::Ipv4Address dest, ns3::Ipv4Address nextHop, uint32_t interface) [member function]
cls.add_method('AddHostRouteTo',
'void',
[param('ns3::Ipv4Address', 'dest'), param('ns3::Ipv4Address', 'nextHop'), param('uint32_t', 'interface')])
## ipv4-static-routing.h: void ns3::Ipv4StaticRouting::AddHostRouteTo(ns3::Ipv4Address dest, uint32_t interface) [member function]
cls.add_method('AddHostRouteTo',
'void',
[param('ns3::Ipv4Address', 'dest'), param('uint32_t', 'interface')])
## ipv4-static-routing.h: void ns3::Ipv4StaticRouting::AddNetworkRouteTo(ns3::Ipv4Address network, ns3::Ipv4Mask networkMask, ns3::Ipv4Address nextHop, uint32_t interface) [member function]
cls.add_method('AddNetworkRouteTo',
'void',
[param('ns3::Ipv4Address', 'network'), param('ns3::Ipv4Mask', 'networkMask'), param('ns3::Ipv4Address', 'nextHop'), param('uint32_t', 'interface')])
## ipv4-static-routing.h: void ns3::Ipv4StaticRouting::AddNetworkRouteTo(ns3::Ipv4Address network, ns3::Ipv4Mask networkMask, uint32_t interface) [member function]
cls.add_method('AddNetworkRouteTo',
'void',
[param('ns3::Ipv4Address', 'network'), param('ns3::Ipv4Mask', 'networkMask'), param('uint32_t', 'interface')])
## ipv4-static-routing.h: void ns3::Ipv4StaticRouting::SetDefaultRoute(ns3::Ipv4Address nextHop, uint32_t interface) [member function]
cls.add_method('SetDefaultRoute',
'void',
[param('ns3::Ipv4Address', 'nextHop'), param('uint32_t', 'interface')])
## ipv4-static-routing.h: uint32_t ns3::Ipv4StaticRouting::GetNRoutes() [member function]
cls.add_method('GetNRoutes',
'uint32_t',
[])
## ipv4-static-routing.h: ns3::Ipv4Route * ns3::Ipv4StaticRouting::GetDefaultRoute() [member function]
cls.add_method('GetDefaultRoute',
'ns3::Ipv4Route *',
[])
## ipv4-static-routing.h: ns3::Ipv4Route * ns3::Ipv4StaticRouting::GetRoute(uint32_t i) [member function]
cls.add_method('GetRoute',
'ns3::Ipv4Route *',
[param('uint32_t', 'i')])
## ipv4-static-routing.h: void ns3::Ipv4StaticRouting::RemoveRoute(uint32_t i) [member function]
cls.add_method('RemoveRoute',
'void',
[param('uint32_t', 'i')])
## ipv4-static-routing.h: void ns3::Ipv4StaticRouting::AddMulticastRoute(ns3::Ipv4Address origin, ns3::Ipv4Address group, uint32_t inputInterface, std::vector<unsigned int, std::allocator<unsigned int> > outputInterfaces) [member function]
cls.add_method('AddMulticastRoute',
'void',
[param('ns3::Ipv4Address', 'origin'), param('ns3::Ipv4Address', 'group'), param('uint32_t', 'inputInterface'), param('std::vector< unsigned int >', 'outputInterfaces')])
## ipv4-static-routing.h: void ns3::Ipv4StaticRouting::SetDefaultMulticastRoute(uint32_t outputInterface) [member function]
cls.add_method('SetDefaultMulticastRoute',
'void',
[param('uint32_t', 'outputInterface')])
## ipv4-static-routing.h: uint32_t ns3::Ipv4StaticRouting::GetNMulticastRoutes() const [member function]
cls.add_method('GetNMulticastRoutes',
'uint32_t',
[],
is_const=True)
## ipv4-static-routing.h: ns3::Ipv4MulticastRoute * ns3::Ipv4StaticRouting::GetMulticastRoute(uint32_t i) const [member function]
cls.add_method('GetMulticastRoute',
'ns3::Ipv4MulticastRoute *',
[param('uint32_t', 'i')],
is_const=True)
## ipv4-static-routing.h: ns3::Ipv4MulticastRoute * ns3::Ipv4StaticRouting::GetDefaultMulticastRoute() const [member function]
cls.add_method('GetDefaultMulticastRoute',
'ns3::Ipv4MulticastRoute *',
[],
is_const=True)
## ipv4-static-routing.h: bool ns3::Ipv4StaticRouting::RemoveMulticastRoute(ns3::Ipv4Address origin, ns3::Ipv4Address group, uint32_t inputInterface) [member function]
cls.add_method('RemoveMulticastRoute',
'bool',
[param('ns3::Ipv4Address', 'origin'), param('ns3::Ipv4Address', 'group'), param('uint32_t', 'inputInterface')])
## ipv4-static-routing.h: void ns3::Ipv4StaticRouting::RemoveMulticastRoute(uint32_t index) [member function]
cls.add_method('RemoveMulticastRoute',
'void',
[param('uint32_t', 'index')])
## ipv4-static-routing.h: void ns3::Ipv4StaticRouting::DoDispose() [member function]
cls.add_method('DoDispose',
'void',
[],
visibility='protected', is_virtual=True)
return
def register_Ns3Ipv4L3Protocol_methods(root_module, cls):
## ipv4-l3-protocol.h: ns3::Ipv4L3Protocol::PROT_NUMBER [variable]
cls.add_static_attribute('PROT_NUMBER', 'uint16_t const', is_const=True)
......@@ -621,6 +532,95 @@ def register_Ns3Ipv4L3Protocol_methods(root_module, cls):
visibility='protected', is_virtual=True)
return
def register_Ns3Ipv4StaticRouting_methods(root_module, cls):
## ipv4-static-routing.h: ns3::Ipv4StaticRouting::Ipv4StaticRouting(ns3::Ipv4StaticRouting const & arg0) [copy constructor]
cls.add_constructor([param('ns3::Ipv4StaticRouting const &', 'arg0')])
## ipv4-static-routing.h: ns3::Ipv4StaticRouting::Ipv4StaticRouting() [constructor]
cls.add_constructor([])
## ipv4-static-routing.h: bool ns3::Ipv4StaticRouting::RequestRoute(uint32_t ifIndex, ns3::Ipv4Header const & ipHeader, ns3::Ptr<ns3::Packet> packet, ns3::Callback<void,bool,const ns3::Ipv4Route&,ns3::Ptr<ns3::Packet>,const ns3::Ipv4Header&,ns3::empty,ns3::empty> routeReply) [member function]
cls.add_method('RequestRoute',
'bool',
[param('uint32_t', 'ifIndex'), param('ns3::Ipv4Header const &', 'ipHeader'), param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Callback< void, bool, const ns3::Ipv4Route&, ns3::Ptr< ns3::Packet >, const ns3::Ipv4Header&, ns3::empty, ns3::empty >', 'routeReply')],
is_virtual=True)
## ipv4-static-routing.h: bool ns3::Ipv4StaticRouting::RequestIfIndex(ns3::Ipv4Address destination, uint32_t & ifIndex) [member function]
cls.add_method('RequestIfIndex',
'bool',
[param('ns3::Ipv4Address', 'destination'), param('uint32_t &', 'ifIndex')],
is_virtual=True)
## ipv4-static-routing.h: void ns3::Ipv4StaticRouting::AddHostRouteTo(ns3::Ipv4Address dest, ns3::Ipv4Address nextHop, uint32_t interface) [member function]
cls.add_method('AddHostRouteTo',
'void',
[param('ns3::Ipv4Address', 'dest'), param('ns3::Ipv4Address', 'nextHop'), param('uint32_t', 'interface')])
## ipv4-static-routing.h: void ns3::Ipv4StaticRouting::AddHostRouteTo(ns3::Ipv4Address dest, uint32_t interface) [member function]
cls.add_method('AddHostRouteTo',
'void',
[param('ns3::Ipv4Address', 'dest'), param('uint32_t', 'interface')])
## ipv4-static-routing.h: void ns3::Ipv4StaticRouting::AddNetworkRouteTo(ns3::Ipv4Address network, ns3::Ipv4Mask networkMask, ns3::Ipv4Address nextHop, uint32_t interface) [member function]
cls.add_method('AddNetworkRouteTo',
'void',
[param('ns3::Ipv4Address', 'network'), param('ns3::Ipv4Mask', 'networkMask'), param('ns3::Ipv4Address', 'nextHop'), param('uint32_t', 'interface')])
## ipv4-static-routing.h: void ns3::Ipv4StaticRouting::AddNetworkRouteTo(ns3::Ipv4Address network, ns3::Ipv4Mask networkMask, uint32_t interface) [member function]
cls.add_method('AddNetworkRouteTo',
'void',
[param('ns3::Ipv4Address', 'network'), param('ns3::Ipv4Mask', 'networkMask'), param('uint32_t', 'interface')])
## ipv4-static-routing.h: void ns3::Ipv4StaticRouting::SetDefaultRoute(ns3::Ipv4Address nextHop, uint32_t interface) [member function]
cls.add_method('SetDefaultRoute',
'void',
[param('ns3::Ipv4Address', 'nextHop'), param('uint32_t', 'interface')])
## ipv4-static-routing.h: uint32_t ns3::Ipv4StaticRouting::GetNRoutes() [member function]
cls.add_method('GetNRoutes',
'uint32_t',
[])
## ipv4-static-routing.h: ns3::Ipv4Route * ns3::Ipv4StaticRouting::GetDefaultRoute() [member function]
cls.add_method('GetDefaultRoute',
'ns3::Ipv4Route *',
[])
## ipv4-static-routing.h: ns3::Ipv4Route * ns3::Ipv4StaticRouting::GetRoute(uint32_t i) [member function]
cls.add_method('GetRoute',
'ns3::Ipv4Route *',
[param('uint32_t', 'i')])
## ipv4-static-routing.h: void ns3::Ipv4StaticRouting::RemoveRoute(uint32_t i) [member function]
cls.add_method('RemoveRoute',
'void',
[param('uint32_t', 'i')])
## ipv4-static-routing.h: void ns3::Ipv4StaticRouting::AddMulticastRoute(ns3::Ipv4Address origin, ns3::Ipv4Address group, uint32_t inputInterface, std::vector<unsigned int, std::allocator<unsigned int> > outputInterfaces) [member function]
cls.add_method('AddMulticastRoute',
'void',
[param('ns3::Ipv4Address', 'origin'), param('ns3::Ipv4Address', 'group'), param('uint32_t', 'inputInterface'), param('std::vector< unsigned int >', 'outputInterfaces')])
## ipv4-static-routing.h: void ns3::Ipv4StaticRouting::SetDefaultMulticastRoute(uint32_t outputInterface) [member function]
cls.add_method('SetDefaultMulticastRoute',
'void',
[param('uint32_t', 'outputInterface')])
## ipv4-static-routing.h: uint32_t ns3::Ipv4StaticRouting::GetNMulticastRoutes() const [member function]
cls.add_method('GetNMulticastRoutes',
'uint32_t',
[],
is_const=True)
## ipv4-static-routing.h: ns3::Ipv4MulticastRoute * ns3::Ipv4StaticRouting::GetMulticastRoute(uint32_t i) const [member function]
cls.add_method('GetMulticastRoute',
'ns3::Ipv4MulticastRoute *',
[param('uint32_t', 'i')],
is_const=True)
## ipv4-static-routing.h: ns3::Ipv4MulticastRoute * ns3::Ipv4StaticRouting::GetDefaultMulticastRoute() const [member function]
cls.add_method('GetDefaultMulticastRoute',
'ns3::Ipv4MulticastRoute *',
[],
is_const=True)
## ipv4-static-routing.h: bool ns3::Ipv4StaticRouting::RemoveMulticastRoute(ns3::Ipv4Address origin, ns3::Ipv4Address group, uint32_t inputInterface) [member function]
cls.add_method('RemoveMulticastRoute',
'bool',
[param('ns3::Ipv4Address', 'origin'), param('ns3::Ipv4Address', 'group'), param('uint32_t', 'inputInterface')])
## ipv4-static-routing.h: void ns3::Ipv4StaticRouting::RemoveMulticastRoute(uint32_t index) [member function]
cls.add_method('RemoveMulticastRoute',
'void',
[param('uint32_t', 'index')])
## ipv4-static-routing.h: void ns3::Ipv4StaticRouting::DoDispose() [member function]
cls.add_method('DoDispose',
'void',
[],
visibility='protected', is_virtual=True)
return
def register_functions(root_module):
module = root_module
## internet-stack.h: extern void ns3::AddInternetStack(ns3::Ptr<ns3::Node> node) [free function]
......
......@@ -19,10 +19,10 @@ def register_types(module):
module.add_class('PositionAllocator', parent=root_module['ns3::Object'])
## position-allocator.h: ns3::ListPositionAllocator [class]
module.add_class('ListPositionAllocator', parent=root_module['ns3::PositionAllocator'])
## position-allocator.h: ns3::RandomRectanglePositionAllocator [class]
module.add_class('RandomRectanglePositionAllocator', parent=root_module['ns3::PositionAllocator'])
## rectangle.h: ns3::RectangleValue [class]
module.add_class('RectangleValue', parent=root_module['ns3::AttributeValue'])
## position-allocator.h: ns3::RandomRectanglePositionAllocator [class]
module.add_class('RandomRectanglePositionAllocator', parent=root_module['ns3::PositionAllocator'])
## vector.h: ns3::VectorValue [class]
module.add_class('VectorValue', parent=root_module['ns3::AttributeValue'])
## position-allocator.h: ns3::RandomDiscPositionAllocator [class]
......@@ -96,8 +96,8 @@ def register_methods(root_module):
register_Ns3Rectangle_methods(root_module, root_module['ns3::Rectangle'])
register_Ns3PositionAllocator_methods(root_module, root_module['ns3::PositionAllocator'])
register_Ns3ListPositionAllocator_methods(root_module, root_module['ns3::ListPositionAllocator'])
register_Ns3RandomRectanglePositionAllocator_methods(root_module, root_module['ns3::RandomRectanglePositionAllocator'])
register_Ns3RectangleValue_methods(root_module, root_module['ns3::RectangleValue'])
register_Ns3RandomRectanglePositionAllocator_methods(root_module, root_module['ns3::RandomRectanglePositionAllocator'])
register_Ns3VectorValue_methods(root_module, root_module['ns3::VectorValue'])
register_Ns3RandomDiscPositionAllocator_methods(root_module, root_module['ns3::RandomDiscPositionAllocator'])
register_Ns3MobilityModel_methods(root_module, root_module['ns3::MobilityModel'])
......@@ -257,31 +257,6 @@ def register_Ns3ListPositionAllocator_methods(root_module, cls):
is_const=True, is_virtual=True)
return
def register_Ns3RandomRectanglePositionAllocator_methods(root_module, cls):
## position-allocator.h: ns3::RandomRectanglePositionAllocator::RandomRectanglePositionAllocator(ns3::RandomRectanglePositionAllocator const & arg0) [copy constructor]
cls.add_constructor([param('ns3::RandomRectanglePositionAllocator const &', 'arg0')])
## position-allocator.h: static ns3::TypeId ns3::RandomRectanglePositionAllocator::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## position-allocator.h: ns3::RandomRectanglePositionAllocator::RandomRectanglePositionAllocator() [constructor]
cls.add_constructor([])
## position-allocator.h: void ns3::RandomRectanglePositionAllocator::SetX(ns3::RandomVariable x) [member function]
cls.add_method('SetX',
'void',
[param('ns3::RandomVariable', 'x')])
## position-allocator.h: void ns3::RandomRectanglePositionAllocator::SetY(ns3::RandomVariable y) [member function]
cls.add_method('SetY',
'void',
[param('ns3::RandomVariable', 'y')])
## position-allocator.h: ns3::Vector ns3::RandomRectanglePositionAllocator::GetNext() const [member function]
cls.add_method('GetNext',
'ns3::Vector',
[],
is_const=True, is_virtual=True)
return
def register_Ns3RectangleValue_methods(root_module, cls):
## rectangle.h: ns3::RectangleValue::RectangleValue(ns3::RectangleValue const & arg0) [copy constructor]
cls.add_constructor([param('ns3::RectangleValue const &', 'arg0')])
......@@ -315,6 +290,31 @@ def register_Ns3RectangleValue_methods(root_module, cls):
is_virtual=True)
return
def register_Ns3RandomRectanglePositionAllocator_methods(root_module, cls):
## position-allocator.h: ns3::RandomRectanglePositionAllocator::RandomRectanglePositionAllocator(ns3::RandomRectanglePositionAllocator const & arg0) [copy constructor]
cls.add_constructor([param('ns3::RandomRectanglePositionAllocator const &', 'arg0')])
## position-allocator.h: static ns3::TypeId ns3::RandomRectanglePositionAllocator::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## position-allocator.h: ns3::RandomRectanglePositionAllocator::RandomRectanglePositionAllocator() [constructor]
cls.add_constructor([])
## position-allocator.h: void ns3::RandomRectanglePositionAllocator::SetX(ns3::RandomVariable x) [member function]
cls.add_method('SetX',
'void',
[param('ns3::RandomVariable', 'x')])
## position-allocator.h: void ns3::RandomRectanglePositionAllocator::SetY(ns3::RandomVariable y) [member function]
cls.add_method('SetY',
'void',
[param('ns3::RandomVariable', 'y')])
## position-allocator.h: ns3::Vector ns3::RandomRectanglePositionAllocator::GetNext() const [member function]
cls.add_method('GetNext',
'ns3::Vector',
[],
is_const=True, is_virtual=True)
return
def register_Ns3VectorValue_methods(root_module, cls):
## vector.h: ns3::VectorValue::VectorValue(ns3::VectorValue const & arg0) [copy constructor]
cls.add_constructor([param('ns3::VectorValue const &', 'arg0')])
......@@ -695,14 +695,14 @@ def register_functions(root_module):
module.add_function('MakeRectangleChecker',
'ns3::Ptr< ns3::AttributeChecker const >',
[])
## vector.h: extern double ns3::CalculateDistance(ns3::Vector const & a, ns3::Vector const & b) [free function]
module.add_function('CalculateDistance',
'double',
[param('ns3::Vector const &', 'a'), param('ns3::Vector const &', 'b')])
## vector.h: extern ns3::Ptr<ns3::AttributeChecker const> ns3::MakeVectorChecker() [free function]
module.add_function('MakeVectorChecker',
'ns3::Ptr< ns3::AttributeChecker const >',
[])
## vector.h: extern double ns3::CalculateDistance(ns3::Vector const & a, ns3::Vector const & b) [free function]
module.add_function('CalculateDistance',
'double',
[param('ns3::Vector const &', 'a'), param('ns3::Vector const &', 'b')])
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)
......
......@@ -1625,8 +1625,8 @@ def register_Ns3NetDevice_methods(root_module, cls):
'void',
[param('ns3::Callback< bool, ns3::Ptr< ns3::NetDevice >, ns3::Ptr< ns3::Packet const >, unsigned short, ns3::Address const&, ns3::Address const&, ns3::NetDevice::PacketType >', 'cb')],
is_pure_virtual=True, is_virtual=True)
## net-device.h: bool ns3::NetDevice::SupportsPromiscuous() const [member function]
cls.add_method('SupportsPromiscuous',
## net-device.h: bool ns3::NetDevice::SupportsSendFrom() const [member function]
cls.add_method('SupportsSendFrom',
'bool',
[],
is_pure_virtual=True, is_const=True, is_virtual=True)
......@@ -2534,8 +2534,8 @@ def register_Ns3SimpleNetDevice_methods(root_module, cls):
'void',
[param('ns3::Callback< bool, ns3::Ptr< ns3::NetDevice >, ns3::Ptr< ns3::Packet const >, unsigned short, ns3::Address const&, ns3::Address const&, ns3::NetDevice::PacketType >', 'cb')],
is_virtual=True)
## simple-net-device.h: bool ns3::SimpleNetDevice::SupportsPromiscuous() const [member function]
cls.add_method('SupportsPromiscuous',
## simple-net-device.h: bool ns3::SimpleNetDevice::SupportsSendFrom() const [member function]
cls.add_method('SupportsSendFrom',
'bool',
[],
is_const=True, is_virtual=True)
......
......@@ -241,8 +241,8 @@ def register_Ns3PointToPointNetDevice_methods(root_module, cls):
'void',
[param('ns3::Callback< bool, ns3::Ptr< ns3::NetDevice >, ns3::Ptr< ns3::Packet const >, unsigned short, ns3::Address const&, ns3::Address const&, ns3::NetDevice::PacketType >', 'cb')],
is_virtual=True)
## point-to-point-net-device.h: bool ns3::PointToPointNetDevice::SupportsPromiscuous() const [member function]
cls.add_method('SupportsPromiscuous',
## point-to-point-net-device.h: bool ns3::PointToPointNetDevice::SupportsSendFrom() const [member function]
cls.add_method('SupportsSendFrom',
'bool',
[],
is_const=True, is_virtual=True)
......
......@@ -9,6 +9,8 @@ def register_types(module):
module.add_enum('DestroyPolicy', ['CANCEL_ON_DESTROY', 'REMOVE_ON_DESTROY', 'CHECK_ON_DESTROY'], outer_class=root_module['ns3::Timer'])
## timer.h: ns3::Timer::State [enumeration]
module.add_enum('State', ['RUNNING', 'EXPIRED', 'SUSPENDED'], outer_class=root_module['ns3::Timer'])
## event-impl.h: ns3::EventImpl [class]
module.add_class('EventImpl', allow_subclassing=True)
## timer-impl.h: ns3::TimerImpl [class]
module.add_class('TimerImpl', allow_subclassing=True)
## nstime.h: ns3::TimeUnit<1> [class]
......@@ -23,8 +25,6 @@ def register_types(module):
module.add_class('EventLock', allow_subclassing=True)
## event-id.h: ns3::EventId [class]
module.add_class('EventId')
## event-impl.h: ns3::EventImpl [class]
module.add_class('EventImpl', allow_subclassing=True)
## realtime-simulator-impl.h: ns3::RealtimeEventLock [class]
module.add_class('RealtimeEventLock', parent=root_module['ns3::EventLock'])
## high-precision-128.h: ns3::HighPrecision [class]
......@@ -47,10 +47,10 @@ def register_types(module):
module.add_class('DefaultSimulatorImpl', parent=root_module['ns3::SimulatorImpl'])
## synchronizer.h: ns3::Synchronizer [class]
module.add_class('Synchronizer', parent=root_module['ns3::Object'])
## heap-scheduler.h: ns3::HeapScheduler [class]
module.add_class('HeapScheduler', parent=root_module['ns3::Scheduler'])
## list-scheduler.h: ns3::ListScheduler [class]
module.add_class('ListScheduler', parent=root_module['ns3::Scheduler'])
## heap-scheduler.h: ns3::HeapScheduler [class]
module.add_class('HeapScheduler', parent=root_module['ns3::Scheduler'])
## map-scheduler.h: ns3::MapScheduler [class]
module.add_class('MapScheduler', parent=root_module['ns3::Scheduler'])
## wall-clock-synchronizer.h: ns3::WallClockSynchronizer [class]
......@@ -100,6 +100,7 @@ def register_types_ns3_olsr(module):
def register_methods(root_module):
register_Ns3Timer_methods(root_module, root_module['ns3::Timer'])
register_Ns3EventImpl_methods(root_module, root_module['ns3::EventImpl'])
register_Ns3TimerImpl_methods(root_module, root_module['ns3::TimerImpl'])
register_Ns3Time_methods(root_module, root_module['ns3::Time'])
register_Ns3Scalar_methods(root_module, root_module['ns3::Scalar'])
......@@ -107,7 +108,6 @@ def register_methods(root_module):
register_Ns3Simulator_methods(root_module, root_module['ns3::Simulator'])
register_Ns3EventLock_methods(root_module, root_module['ns3::EventLock'])
register_Ns3EventId_methods(root_module, root_module['ns3::EventId'])
register_Ns3EventImpl_methods(root_module, root_module['ns3::EventImpl'])
register_Ns3RealtimeEventLock_methods(root_module, root_module['ns3::RealtimeEventLock'])
register_Ns3HighPrecision_methods(root_module, root_module['ns3::HighPrecision'])
register_Ns3TimeChecker_methods(root_module, root_module['ns3::TimeChecker'])
......@@ -118,8 +118,8 @@ def register_methods(root_module):
register_Ns3RealtimeSimulatorImpl_methods(root_module, root_module['ns3::RealtimeSimulatorImpl'])
register_Ns3DefaultSimulatorImpl_methods(root_module, root_module['ns3::DefaultSimulatorImpl'])
register_Ns3Synchronizer_methods(root_module, root_module['ns3::Synchronizer'])
register_Ns3HeapScheduler_methods(root_module, root_module['ns3::HeapScheduler'])
register_Ns3ListScheduler_methods(root_module, root_module['ns3::ListScheduler'])
register_Ns3HeapScheduler_methods(root_module, root_module['ns3::HeapScheduler'])
register_Ns3MapScheduler_methods(root_module, root_module['ns3::MapScheduler'])
register_Ns3WallClockSynchronizer_methods(root_module, root_module['ns3::WallClockSynchronizer'])
return
......@@ -191,6 +191,50 @@ def register_Ns3Timer_methods(root_module, cls):
[])
return
def register_Ns3EventImpl_methods(root_module, cls):
## event-impl.h: ns3::EventImpl::EventImpl(ns3::EventImpl const & arg0) [copy constructor]
cls.add_constructor([param('ns3::EventImpl const &', 'arg0')])
## event-impl.h: ns3::EventImpl::EventImpl() [constructor]
cls.add_constructor([])
## event-impl.h: void ns3::EventImpl::Ref() const [member function]
cls.add_method('Ref',
'void',
[],
is_const=True)
## event-impl.h: void ns3::EventImpl::Unref() const [member function]
cls.add_method('Unref',
'void',
[],
is_const=True)
## event-impl.h: void ns3::EventImpl::Invoke() [member function]
cls.add_method('Invoke',
'void',
[])
## event-impl.h: void ns3::EventImpl::Cancel() [member function]
cls.add_method('Cancel',
'void',
[])
## event-impl.h: bool ns3::EventImpl::IsCancelled() [member function]
cls.add_method('IsCancelled',
'bool',
[])
## event-impl.h: static void ns3::EventImpl::SetEventLock(ns3::EventLock * eventLock) [member function]
cls.add_method('SetEventLock',
'void',
[param('ns3::EventLock *', 'eventLock')],
is_static=True)
## event-impl.h: static void ns3::EventImpl::SetNoEventLock() [member function]
cls.add_method('SetNoEventLock',
'void',
[],
is_static=True)
## event-impl.h: void ns3::EventImpl::Notify() [member function]
cls.add_method('Notify',
'void',
[],
is_pure_virtual=True, visibility='protected', is_virtual=True)
return
def register_Ns3TimerImpl_methods(root_module, cls):
## timer-impl.h: ns3::TimerImpl::TimerImpl(ns3::TimerImpl const & arg0) [copy constructor]
cls.add_constructor([param('ns3::TimerImpl const &', 'arg0')])
......@@ -497,50 +541,6 @@ def register_Ns3EventId_methods(root_module, cls):
is_const=True)
return
def register_Ns3EventImpl_methods(root_module, cls):
## event-impl.h: ns3::EventImpl::EventImpl(ns3::EventImpl const & arg0) [copy constructor]
cls.add_constructor([param('ns3::EventImpl const &', 'arg0')])
## event-impl.h: ns3::EventImpl::EventImpl() [constructor]
cls.add_constructor([])
## event-impl.h: void ns3::EventImpl::Ref() const [member function]
cls.add_method('Ref',
'void',
[],
is_const=True)
## event-impl.h: void ns3::EventImpl::Unref() const [member function]
cls.add_method('Unref',
'void',
[],
is_const=True)
## event-impl.h: void ns3::EventImpl::Invoke() [member function]
cls.add_method('Invoke',
'void',
[])
## event-impl.h: void ns3::EventImpl::Cancel() [member function]
cls.add_method('Cancel',
'void',
[])
## event-impl.h: bool ns3::EventImpl::IsCancelled() [member function]
cls.add_method('IsCancelled',
'bool',
[])
## event-impl.h: static void ns3::EventImpl::SetEventLock(ns3::EventLock * eventLock) [member function]
cls.add_method('SetEventLock',
'void',
[param('ns3::EventLock *', 'eventLock')],
is_static=True)
## event-impl.h: static void ns3::EventImpl::SetNoEventLock() [member function]
cls.add_method('SetNoEventLock',
'void',
[],
is_static=True)
## event-impl.h: void ns3::EventImpl::Notify() [member function]
cls.add_method('Notify',
'void',
[],
is_pure_virtual=True, visibility='protected', is_virtual=True)
return
def register_Ns3RealtimeEventLock_methods(root_module, cls):
## realtime-simulator-impl.h: ns3::RealtimeEventLock::RealtimeEventLock(ns3::RealtimeEventLock const & arg0) [copy constructor]
cls.add_constructor([param('ns3::RealtimeEventLock const &', 'arg0')])
......@@ -1114,64 +1114,64 @@ def register_Ns3Synchronizer_methods(root_module, cls):
is_pure_virtual=True, visibility='protected', is_virtual=True)
return
def register_Ns3HeapScheduler_methods(root_module, cls):
## heap-scheduler.h: ns3::HeapScheduler::HeapScheduler(ns3::HeapScheduler const & arg0) [copy constructor]
cls.add_constructor([param('ns3::HeapScheduler const &', 'arg0')])
## heap-scheduler.h: ns3::HeapScheduler::HeapScheduler() [constructor]
def register_Ns3ListScheduler_methods(root_module, cls):
## list-scheduler.h: ns3::ListScheduler::ListScheduler(ns3::ListScheduler const & arg0) [copy constructor]
cls.add_constructor([param('ns3::ListScheduler const &', 'arg0')])
## list-scheduler.h: ns3::ListScheduler::ListScheduler() [constructor]
cls.add_constructor([])
## heap-scheduler.h: void ns3::HeapScheduler::Insert(ns3::EventId const & id) [member function]
## list-scheduler.h: void ns3::ListScheduler::Insert(ns3::EventId const & id) [member function]
cls.add_method('Insert',
'void',
[param('ns3::EventId const &', 'id')],
is_virtual=True)
## heap-scheduler.h: bool ns3::HeapScheduler::IsEmpty() const [member function]
## list-scheduler.h: bool ns3::ListScheduler::IsEmpty() const [member function]
cls.add_method('IsEmpty',
'bool',
[],
is_const=True, is_virtual=True)
## heap-scheduler.h: ns3::EventId ns3::HeapScheduler::PeekNext() const [member function]
## list-scheduler.h: ns3::EventId ns3::ListScheduler::PeekNext() const [member function]
cls.add_method('PeekNext',
'ns3::EventId',
[],
is_const=True, is_virtual=True)
## heap-scheduler.h: ns3::EventId ns3::HeapScheduler::RemoveNext() [member function]
## list-scheduler.h: ns3::EventId ns3::ListScheduler::RemoveNext() [member function]
cls.add_method('RemoveNext',
'ns3::EventId',
[],
is_virtual=True)
## heap-scheduler.h: bool ns3::HeapScheduler::Remove(ns3::EventId const & ev) [member function]
## list-scheduler.h: bool ns3::ListScheduler::Remove(ns3::EventId const & ev) [member function]
cls.add_method('Remove',
'bool',
[param('ns3::EventId const &', 'ev')],
is_virtual=True)
return
def register_Ns3ListScheduler_methods(root_module, cls):
## list-scheduler.h: ns3::ListScheduler::ListScheduler(ns3::ListScheduler const & arg0) [copy constructor]
cls.add_constructor([param('ns3::ListScheduler const &', 'arg0')])
## list-scheduler.h: ns3::ListScheduler::ListScheduler() [constructor]
def register_Ns3HeapScheduler_methods(root_module, cls):
## heap-scheduler.h: ns3::HeapScheduler::HeapScheduler(ns3::HeapScheduler const & arg0) [copy constructor]
cls.add_constructor([param('ns3::HeapScheduler const &', 'arg0')])
## heap-scheduler.h: ns3::HeapScheduler::HeapScheduler() [constructor]
cls.add_constructor([])
## list-scheduler.h: void ns3::ListScheduler::Insert(ns3::EventId const & id) [member function]
## heap-scheduler.h: void ns3::HeapScheduler::Insert(ns3::EventId const & id) [member function]
cls.add_method('Insert',
'void',
[param('ns3::EventId const &', 'id')],
is_virtual=True)
## list-scheduler.h: bool ns3::ListScheduler::IsEmpty() const [member function]
## heap-scheduler.h: bool ns3::HeapScheduler::IsEmpty() const [member function]
cls.add_method('IsEmpty',
'bool',
[],
is_const=True, is_virtual=True)
## list-scheduler.h: ns3::EventId ns3::ListScheduler::PeekNext() const [member function]
## heap-scheduler.h: ns3::EventId ns3::HeapScheduler::PeekNext() const [member function]
cls.add_method('PeekNext',
'ns3::EventId',
[],
is_const=True, is_virtual=True)
## list-scheduler.h: ns3::EventId ns3::ListScheduler::RemoveNext() [member function]
## heap-scheduler.h: ns3::EventId ns3::HeapScheduler::RemoveNext() [member function]
cls.add_method('RemoveNext',
'ns3::EventId',
[],
is_virtual=True)
## list-scheduler.h: bool ns3::ListScheduler::Remove(ns3::EventId const & ev) [member function]
## heap-scheduler.h: bool ns3::HeapScheduler::Remove(ns3::EventId const & ev) [member function]
cls.add_method('Remove',
'bool',
[param('ns3::EventId const &', 'ev')],
......
......@@ -23,8 +23,6 @@ def register_types(module):
module.add_class('PacketSizeMinMaxAvgTotalCalculator', parent=root_module['ns3::MinMaxAvgTotalCalculator< unsigned int >'])
## omnet-data-output.h: ns3::OmnetDataOutput [class]
module.add_class('OmnetDataOutput', parent=root_module['ns3::DataOutputInterface'])
## sqlite-data-output.h: ns3::SqliteDataOutput [class]
module.add_class('SqliteDataOutput', parent=root_module['ns3::DataOutputInterface'])
## Register a nested module for the namespace internal
......@@ -77,7 +75,6 @@ def register_methods(root_module):
register_Ns3PacketCounterCalculator_methods(root_module, root_module['ns3::PacketCounterCalculator'])
register_Ns3PacketSizeMinMaxAvgTotalCalculator_methods(root_module, root_module['ns3::PacketSizeMinMaxAvgTotalCalculator'])
register_Ns3OmnetDataOutput_methods(root_module, root_module['ns3::OmnetDataOutput'])
register_Ns3SqliteDataOutput_methods(root_module, root_module['ns3::SqliteDataOutput'])
return
def register_Ns3DataOutputCallback_methods(root_module, cls):
......@@ -134,9 +131,9 @@ def register_Ns3DataCalculator_methods(root_module, cls):
cls.add_method('SetKey',
'void',
[param('std::string const', 'key')])
## data-calculator.h: std::string const ns3::DataCalculator::GetKey() const [member function]
## data-calculator.h: std::string ns3::DataCalculator::GetKey() const [member function]
cls.add_method('GetKey',
'std::string const',
'std::string',
[],
is_const=True)
## data-calculator.h: void ns3::DataCalculator::Start(ns3::Time const & startTime) [member function]
......@@ -391,32 +388,6 @@ def register_Ns3OmnetDataOutput_methods(root_module, cls):
visibility='protected', is_virtual=True)
return
def register_Ns3SqliteDataOutput_methods(root_module, cls):
## sqlite-data-output.h: ns3::SqliteDataOutput::SqliteDataOutput(ns3::SqliteDataOutput const & arg0) [copy constructor]
cls.add_constructor([param('ns3::SqliteDataOutput const &', 'arg0')])
## sqlite-data-output.h: ns3::SqliteDataOutput::SqliteDataOutput() [constructor]
cls.add_constructor([])
## sqlite-data-output.h: void ns3::SqliteDataOutput::Output(ns3::DataCollector & dc) [member function]
cls.add_method('Output',
'void',
[param('ns3::DataCollector &', 'dc')],
is_virtual=True)
## sqlite-data-output.h: void ns3::SqliteDataOutput::SetDBFile(std::string const file) [member function]
cls.add_method('SetDBFile',
'void',
[param('std::string const', 'file')])
## sqlite-data-output.h: std::string ns3::SqliteDataOutput::GetDBFile() const [member function]
cls.add_method('GetDBFile',
'std::string',
[],
is_const=True)
## sqlite-data-output.h: void ns3::SqliteDataOutput::DoDispose() [member function]
cls.add_method('DoDispose',
'void',
[],
visibility='protected', is_virtual=True)
return
def register_functions(root_module):
module = root_module
register_functions_ns3_internal(module.get_submodule('internal'), root_module)
......
This diff is collapsed.
......@@ -189,6 +189,14 @@ void
BridgeNetDevice::AddBridgePort (Ptr<NetDevice> bridgePort)
{
NS_ASSERT (bridgePort != this);
if (!Mac48Address::IsMatchingType (bridgePort->GetAddress ()))
{
NS_FATAL_ERROR ("Device does not support eui 48 addresses: cannot be added to bridge.");
}
if (!bridgePort->SupportsSendFrom ())
{
NS_FATAL_ERROR ("Device does not support SendFrom: cannot be added to bridge.");
}
if (m_address == Mac48Address ())
{
m_address = Mac48Address::ConvertFrom (bridgePort->GetAddress ());
......@@ -411,7 +419,7 @@ BridgeNetDevice::SetPromiscReceiveCallback (NetDevice::PromiscReceiveCallback cb
}
bool
BridgeNetDevice::SupportsPromiscuous () const
BridgeNetDevice::SupportsSendFrom () const
{
return true;
}
......
......@@ -106,7 +106,7 @@ public:
virtual bool NeedsArp (void) const;
virtual void SetReceiveCallback (NetDevice::ReceiveCallback cb);
virtual void SetPromiscReceiveCallback (NetDevice::PromiscReceiveCallback cb);
virtual bool SupportsPromiscuous () const;
virtual bool SupportsSendFrom () const;
protected:
virtual void DoDispose (void);
......
......@@ -979,7 +979,7 @@ CsmaNetDevice::SetPromiscReceiveCallback (NetDevice::PromiscReceiveCallback cb)
}
bool
CsmaNetDevice::SupportsPromiscuous () const
CsmaNetDevice::SupportsSendFrom () const
{
NS_LOG_FUNCTION_NOARGS ();
return true;
......
......@@ -385,7 +385,7 @@ public:
virtual void SetPromiscReceiveCallback (PromiscReceiveCallback cb);
virtual bool SupportsPromiscuous (void) const;
virtual bool SupportsSendFrom (void) const;
protected:
/**
......
......@@ -241,7 +241,11 @@ PointToPointNetDevice::Receive (Ptr<Packet> packet)
//
m_rxTrace (packet);
ProcessHeader(packet, protocol);
m_rxCallback (this, packet, protocol, GetBroadcast ());
m_rxCallback (this, packet, protocol, GetRemote ());
if (!m_promiscCallback.IsNull ())
{
m_promiscCallback (this, packet, protocol, GetRemote (), GetAddress (), NetDevice::PACKET_HOST);
}
}
}
......@@ -440,7 +444,7 @@ PointToPointNetDevice::SendFrom (Ptr<Packet> packet,
const Address &dest,
uint16_t protocolNumber)
{
return Send (packet, dest, protocolNumber);
return false;
}
Ptr<Node>
......@@ -467,16 +471,34 @@ PointToPointNetDevice::SetReceiveCallback (NetDevice::ReceiveCallback cb)
m_rxCallback = cb;
}
void
PointToPointNetDevice::SetPromiscReceiveCallback (PromiscReceiveCallback cb)
void
PointToPointNetDevice::SetPromiscReceiveCallback (NetDevice::PromiscReceiveCallback cb)
{
NS_FATAL_ERROR ("not implemented");
m_promiscCallback = cb;
}
bool
PointToPointNetDevice::SupportsPromiscuous (void) const
PointToPointNetDevice::SupportsSendFrom (void) const
{
return false;
}
Address
PointToPointNetDevice::GetRemote (void) const
{
NS_ASSERT (m_channel->GetNDevices () == 2);
for (uint32_t i = 0; i < m_channel->GetNDevices (); ++i)
{
Ptr<NetDevice> tmp = m_channel->GetDevice (i);
if (tmp != this)
{
return tmp->GetAddress ();
}
}
NS_ASSERT (false);
// quiet compiler.
return Address ();
}
} // namespace ns3
......@@ -178,7 +178,7 @@ public:
virtual void SetReceiveCallback (NetDevice::ReceiveCallback cb);
virtual void SetPromiscReceiveCallback (PromiscReceiveCallback cb);
virtual bool SupportsPromiscuous (void) const;
virtual bool SupportsSendFrom (void) const;
private:
......@@ -195,6 +195,11 @@ private:
Ptr<Queue> GetQueue(void) const;
private:
/**
* \returns the address of the remote device connected to this device
* through the point to point channel.
*/
Address GetRemote (void) const;
/**
* Adds the necessary headers and trailers to a packet of data in order to
* respect the protocol implemented by the agent.
......@@ -304,6 +309,7 @@ private:
Ptr<Node> m_node;
Mac48Address m_address;
NetDevice::ReceiveCallback m_rxCallback;
NetDevice::PromiscReceiveCallback m_promiscCallback;
uint32_t m_ifIndex;
std::string m_name;
bool m_linkUp;
......
......@@ -359,7 +359,7 @@ WifiNetDevice::SetPromiscReceiveCallback (PromiscReceiveCallback cb)
}
bool
WifiNetDevice::SupportsPromiscuous (void) const
WifiNetDevice::SupportsSendFrom (void) const
{
return false; // TODO
}
......
......@@ -103,7 +103,7 @@ public:
virtual bool SendFrom(Ptr<Packet> packet, const Address& source, const Address& dest, uint16_t protocolNumber);
virtual void SetPromiscReceiveCallback (PromiscReceiveCallback cb);
virtual bool SupportsPromiscuous (void) const;
virtual bool SupportsSendFrom (void) const;
private:
virtual void DoDispose (void);
......
......@@ -314,7 +314,7 @@ public:
/**
* \return true if this interface supports a promiscuous mode, false otherwise.
*/
virtual bool SupportsPromiscuous (void) const = 0;
virtual bool SupportsSendFrom (void) const = 0;
};
......
......@@ -184,7 +184,7 @@ Node::RegisterProtocolHandler (ProtocolHandler handler,
i != m_devices.end (); i++)
{
Ptr<NetDevice> dev = *i;
if (dev->SupportsPromiscuous ())
if (dev->SupportsSendFrom ())
{
dev->SetPromiscReceiveCallback (MakeCallback (&Node::PromiscReceiveFromDevice, this));
}
......@@ -192,7 +192,7 @@ Node::RegisterProtocolHandler (ProtocolHandler handler,
}
else
{
if (device->SupportsPromiscuous ())
if (device->SupportsSendFrom ())
{
device->SetPromiscReceiveCallback (MakeCallback (&Node::PromiscReceiveFromDevice, this));
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment