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