bindings/python/ns3_module_bridge.py
author vincent@clarinet.u-strasbg.fr
Wed, 05 Nov 2008 14:49:21 -0800
changeset 3842 545ddf9398ed
parent 3731 317f9dbccc2b
child 3855 7fdcbeea6c4f
permissions -rw-r--r--
apply patch for bug 294 (GetMulticastAddr) + emu device update + rescan
     1 from pybindgen import Module, FileCodeSink, param, retval, cppclass
     2 
     3 def register_types(module):
     4     root_module = module.get_root()
     5     
     6     ## bridge-channel.h: ns3::BridgeChannel [class]
     7     module.add_class('BridgeChannel', parent=root_module['ns3::Channel'])
     8     ## bridge-net-device.h: ns3::BridgeNetDevice [class]
     9     module.add_class('BridgeNetDevice', parent=root_module['ns3::NetDevice'])
    10     
    11     ## Register a nested module for the namespace internal
    12     
    13     nested_module = module.add_cpp_namespace('internal')
    14     register_types_ns3_internal(nested_module)
    15     
    16     
    17     ## Register a nested module for the namespace TimeStepPrecision
    18     
    19     nested_module = module.add_cpp_namespace('TimeStepPrecision')
    20     register_types_ns3_TimeStepPrecision(nested_module)
    21     
    22     
    23     ## Register a nested module for the namespace Config
    24     
    25     nested_module = module.add_cpp_namespace('Config')
    26     register_types_ns3_Config(nested_module)
    27     
    28     
    29     ## Register a nested module for the namespace olsr
    30     
    31     nested_module = module.add_cpp_namespace('olsr')
    32     register_types_ns3_olsr(nested_module)
    33     
    34 
    35 def register_types_ns3_internal(module):
    36     root_module = module.get_root()
    37     
    38 
    39 def register_types_ns3_TimeStepPrecision(module):
    40     root_module = module.get_root()
    41     
    42 
    43 def register_types_ns3_Config(module):
    44     root_module = module.get_root()
    45     
    46 
    47 def register_types_ns3_olsr(module):
    48     root_module = module.get_root()
    49     
    50 
    51 def register_methods(root_module):
    52     register_Ns3BridgeChannel_methods(root_module, root_module['ns3::BridgeChannel'])
    53     register_Ns3BridgeNetDevice_methods(root_module, root_module['ns3::BridgeNetDevice'])
    54     return
    55 
    56 def register_Ns3BridgeChannel_methods(root_module, cls):
    57     ## bridge-channel.h: ns3::BridgeChannel::BridgeChannel(ns3::BridgeChannel const & arg0) [copy constructor]
    58     cls.add_constructor([param('ns3::BridgeChannel const &', 'arg0')])
    59     ## bridge-channel.h: static ns3::TypeId ns3::BridgeChannel::GetTypeId() [member function]
    60     cls.add_method('GetTypeId', 
    61                    'ns3::TypeId', 
    62                    [], 
    63                    is_static=True)
    64     ## bridge-channel.h: ns3::BridgeChannel::BridgeChannel() [constructor]
    65     cls.add_constructor([])
    66     ## bridge-channel.h: void ns3::BridgeChannel::AddChannel(ns3::Ptr<ns3::Channel> bridgedChannel) [member function]
    67     cls.add_method('AddChannel', 
    68                    'void', 
    69                    [param('ns3::Ptr< ns3::Channel >', 'bridgedChannel')])
    70     ## bridge-channel.h: uint32_t ns3::BridgeChannel::GetNDevices() const [member function]
    71     cls.add_method('GetNDevices', 
    72                    'uint32_t', 
    73                    [], 
    74                    is_const=True, is_virtual=True)
    75     ## bridge-channel.h: ns3::Ptr<ns3::NetDevice> ns3::BridgeChannel::GetDevice(uint32_t i) const [member function]
    76     cls.add_method('GetDevice', 
    77                    'ns3::Ptr< ns3::NetDevice >', 
    78                    [param('uint32_t', 'i')], 
    79                    is_const=True, is_virtual=True)
    80     return
    81 
    82 def register_Ns3BridgeNetDevice_methods(root_module, cls):
    83     ## bridge-net-device.h: ns3::BridgeNetDevice::BridgeNetDevice(ns3::BridgeNetDevice const & arg0) [copy constructor]
    84     cls.add_constructor([param('ns3::BridgeNetDevice const &', 'arg0')])
    85     ## bridge-net-device.h: static ns3::TypeId ns3::BridgeNetDevice::GetTypeId() [member function]
    86     cls.add_method('GetTypeId', 
    87                    'ns3::TypeId', 
    88                    [], 
    89                    is_static=True)
    90     ## bridge-net-device.h: ns3::BridgeNetDevice::BridgeNetDevice() [constructor]
    91     cls.add_constructor([])
    92     ## bridge-net-device.h: void ns3::BridgeNetDevice::AddBridgePort(ns3::Ptr<ns3::NetDevice> bridgePort) [member function]
    93     cls.add_method('AddBridgePort', 
    94                    'void', 
    95                    [param('ns3::Ptr< ns3::NetDevice >', 'bridgePort')])
    96     ## bridge-net-device.h: void ns3::BridgeNetDevice::SetName(std::string const name) [member function]
    97     cls.add_method('SetName', 
    98                    'void', 
    99                    [param('std::string const', 'name')], 
   100                    is_virtual=True)
   101     ## bridge-net-device.h: std::string ns3::BridgeNetDevice::GetName() const [member function]
   102     cls.add_method('GetName', 
   103                    'std::string', 
   104                    [], 
   105                    is_const=True, is_virtual=True)
   106     ## bridge-net-device.h: void ns3::BridgeNetDevice::SetIfIndex(uint32_t const index) [member function]
   107     cls.add_method('SetIfIndex', 
   108                    'void', 
   109                    [param('uint32_t const', 'index')], 
   110                    is_virtual=True)
   111     ## bridge-net-device.h: uint32_t ns3::BridgeNetDevice::GetIfIndex() const [member function]
   112     cls.add_method('GetIfIndex', 
   113                    'uint32_t', 
   114                    [], 
   115                    is_const=True, is_virtual=True)
   116     ## bridge-net-device.h: ns3::Ptr<ns3::Channel> ns3::BridgeNetDevice::GetChannel() const [member function]
   117     cls.add_method('GetChannel', 
   118                    'ns3::Ptr< ns3::Channel >', 
   119                    [], 
   120                    is_const=True, is_virtual=True)
   121     ## bridge-net-device.h: ns3::Address ns3::BridgeNetDevice::GetAddress() const [member function]
   122     cls.add_method('GetAddress', 
   123                    'ns3::Address', 
   124                    [], 
   125                    is_const=True, is_virtual=True)
   126     ## bridge-net-device.h: bool ns3::BridgeNetDevice::SetMtu(uint16_t const mtu) [member function]
   127     cls.add_method('SetMtu', 
   128                    'bool', 
   129                    [param('uint16_t const', 'mtu')], 
   130                    is_virtual=True)
   131     ## bridge-net-device.h: uint16_t ns3::BridgeNetDevice::GetMtu() const [member function]
   132     cls.add_method('GetMtu', 
   133                    'uint16_t', 
   134                    [], 
   135                    is_const=True, is_virtual=True)
   136     ## bridge-net-device.h: bool ns3::BridgeNetDevice::IsLinkUp() const [member function]
   137     cls.add_method('IsLinkUp', 
   138                    'bool', 
   139                    [], 
   140                    is_const=True, is_virtual=True)
   141     ## 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]
   142     cls.add_method('SetLinkChangeCallback', 
   143                    'void', 
   144                    [param('ns3::Callback< void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'callback')], 
   145                    is_virtual=True)
   146     ## bridge-net-device.h: bool ns3::BridgeNetDevice::IsBroadcast() const [member function]
   147     cls.add_method('IsBroadcast', 
   148                    'bool', 
   149                    [], 
   150                    is_const=True, is_virtual=True)
   151     ## bridge-net-device.h: ns3::Address ns3::BridgeNetDevice::GetBroadcast() const [member function]
   152     cls.add_method('GetBroadcast', 
   153                    'ns3::Address', 
   154                    [], 
   155                    is_const=True, is_virtual=True)
   156     ## bridge-net-device.h: bool ns3::BridgeNetDevice::IsMulticast() const [member function]
   157     cls.add_method('IsMulticast', 
   158                    'bool', 
   159                    [], 
   160                    is_const=True, is_virtual=True)
   161     ## bridge-net-device.h: ns3::Address ns3::BridgeNetDevice::GetMulticast(ns3::Ipv4Address multicastGroup) const [member function]
   162     cls.add_method('GetMulticast', 
   163                    'ns3::Address', 
   164                    [param('ns3::Ipv4Address', 'multicastGroup')], 
   165                    is_const=True, is_virtual=True)
   166     ## bridge-net-device.h: bool ns3::BridgeNetDevice::IsPointToPoint() const [member function]
   167     cls.add_method('IsPointToPoint', 
   168                    'bool', 
   169                    [], 
   170                    is_const=True, is_virtual=True)
   171     ## bridge-net-device.h: bool ns3::BridgeNetDevice::Send(ns3::Ptr<ns3::Packet> packet, ns3::Address const & dest, uint16_t protocolNumber) [member function]
   172     cls.add_method('Send', 
   173                    'bool', 
   174                    [param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Address const &', 'dest'), param('uint16_t', 'protocolNumber')], 
   175                    is_virtual=True)
   176     ## 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]
   177     cls.add_method('SendFrom', 
   178                    'bool', 
   179                    [param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Address const &', 'source'), param('ns3::Address const &', 'dest'), param('uint16_t', 'protocolNumber')], 
   180                    is_virtual=True)
   181     ## bridge-net-device.h: ns3::Ptr<ns3::Node> ns3::BridgeNetDevice::GetNode() const [member function]
   182     cls.add_method('GetNode', 
   183                    'ns3::Ptr< ns3::Node >', 
   184                    [], 
   185                    is_const=True, is_virtual=True)
   186     ## bridge-net-device.h: void ns3::BridgeNetDevice::SetNode(ns3::Ptr<ns3::Node> node) [member function]
   187     cls.add_method('SetNode', 
   188                    'void', 
   189                    [param('ns3::Ptr< ns3::Node >', 'node')], 
   190                    is_virtual=True)
   191     ## bridge-net-device.h: bool ns3::BridgeNetDevice::NeedsArp() const [member function]
   192     cls.add_method('NeedsArp', 
   193                    'bool', 
   194                    [], 
   195                    is_const=True, is_virtual=True)
   196     ## bridge-net-device.h: void ns3::BridgeNetDevice::SetReceiveCallback(ns3::Callback<bool, ns3::Ptr<ns3::NetDevice>, ns3::Ptr<ns3::Packet const>, unsigned short, ns3::Address const&, ns3::empty, ns3::empty> cb) [member function]
   197     cls.add_method('SetReceiveCallback', 
   198                    'void', 
   199                    [param('ns3::Callback< bool, ns3::Ptr< ns3::NetDevice >, ns3::Ptr< ns3::Packet const >, unsigned short, ns3::Address const &, ns3::empty, ns3::empty >', 'cb')], 
   200                    is_virtual=True)
   201     ## bridge-net-device.h: void ns3::BridgeNetDevice::SetPromiscReceiveCallback(ns3::Callback<bool, ns3::Ptr<ns3::NetDevice>, ns3::Ptr<ns3::Packet const>, unsigned short, ns3::Address const&, ns3::Address const&, ns3::NetDevice::PacketType> cb) [member function]
   202     cls.add_method('SetPromiscReceiveCallback', 
   203                    'void', 
   204                    [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')], 
   205                    is_virtual=True)
   206     ## bridge-net-device.h: bool ns3::BridgeNetDevice::SupportsSendFrom() const [member function]
   207     cls.add_method('SupportsSendFrom', 
   208                    'bool', 
   209                    [], 
   210                    is_const=True, is_virtual=True)
   211     ## bridge-net-device.h: void ns3::BridgeNetDevice::DoDispose() [member function]
   212     cls.add_method('DoDispose', 
   213                    'void', 
   214                    [], 
   215                    visibility='protected', is_virtual=True)
   216     ## bridge-net-device.h: void ns3::BridgeNetDevice::ReceiveFromDevice(ns3::Ptr<ns3::NetDevice> device, ns3::Ptr<const ns3::Packet> packet, uint16_t protocol, ns3::Address const & source, ns3::Address const & destination, ns3::NetDevice::PacketType packetType) [member function]
   217     cls.add_method('ReceiveFromDevice', 
   218                    'void', 
   219                    [param('ns3::Ptr< ns3::NetDevice >', 'device'), param('ns3::Ptr< ns3::Packet const >', 'packet'), param('uint16_t', 'protocol'), param('ns3::Address const &', 'source'), param('ns3::Address const &', 'destination'), param('ns3::NetDevice::PacketType', 'packetType')], 
   220                    visibility='protected')
   221     ## bridge-net-device.h: void ns3::BridgeNetDevice::ForwardUnicast(ns3::Ptr<ns3::NetDevice> incomingPort, ns3::Ptr<const ns3::Packet> packet, uint16_t protocol, ns3::Mac48Address src, ns3::Mac48Address dst) [member function]
   222     cls.add_method('ForwardUnicast', 
   223                    'void', 
   224                    [param('ns3::Ptr< ns3::NetDevice >', 'incomingPort'), param('ns3::Ptr< ns3::Packet const >', 'packet'), param('uint16_t', 'protocol'), param('ns3::Mac48Address', 'src'), param('ns3::Mac48Address', 'dst')], 
   225                    visibility='protected')
   226     ## bridge-net-device.h: void ns3::BridgeNetDevice::ForwardBroadcast(ns3::Ptr<ns3::NetDevice> incomingPort, ns3::Ptr<const ns3::Packet> packet, uint16_t protocol, ns3::Mac48Address src, ns3::Mac48Address dst) [member function]
   227     cls.add_method('ForwardBroadcast', 
   228                    'void', 
   229                    [param('ns3::Ptr< ns3::NetDevice >', 'incomingPort'), param('ns3::Ptr< ns3::Packet const >', 'packet'), param('uint16_t', 'protocol'), param('ns3::Mac48Address', 'src'), param('ns3::Mac48Address', 'dst')], 
   230                    visibility='protected')
   231     ## bridge-net-device.h: void ns3::BridgeNetDevice::Learn(ns3::Mac48Address source, ns3::Ptr<ns3::NetDevice> port) [member function]
   232     cls.add_method('Learn', 
   233                    'void', 
   234                    [param('ns3::Mac48Address', 'source'), param('ns3::Ptr< ns3::NetDevice >', 'port')], 
   235                    visibility='protected')
   236     ## bridge-net-device.h: ns3::Ptr<ns3::NetDevice> ns3::BridgeNetDevice::GetLearnedState(ns3::Mac48Address source) [member function]
   237     cls.add_method('GetLearnedState', 
   238                    'ns3::Ptr< ns3::NetDevice >', 
   239                    [param('ns3::Mac48Address', 'source')], 
   240                    visibility='protected')
   241     return
   242 
   243 def register_functions(root_module):
   244     module = root_module
   245     register_functions_ns3_internal(module.get_submodule('internal'), root_module)
   246     register_functions_ns3_TimeStepPrecision(module.get_submodule('TimeStepPrecision'), root_module)
   247     register_functions_ns3_Config(module.get_submodule('Config'), root_module)
   248     register_functions_ns3_olsr(module.get_submodule('olsr'), root_module)
   249     return
   250 
   251 def register_functions_ns3_internal(module, root_module):
   252     return
   253 
   254 def register_functions_ns3_TimeStepPrecision(module, root_module):
   255     return
   256 
   257 def register_functions_ns3_Config(module, root_module):
   258     return
   259 
   260 def register_functions_ns3_olsr(module, root_module):
   261     return
   262