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