bindings/python/ns3_module_emu.py
author vincent@clarinet.u-strasbg.fr
Wed, 05 Nov 2008 14:49:21 -0800
changeset 3842 545ddf9398ed
child 3843 ca2159d54d75
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     ## emu-net-device.h: ns3::EmuNetDevice [class]
     7     module.add_class('EmuNetDevice', parent=root_module['ns3::NetDevice'])
     8     
     9     ## Register a nested module for the namespace internal
    10     
    11     nested_module = module.add_cpp_namespace('internal')
    12     register_types_ns3_internal(nested_module)
    13     
    14     
    15     ## Register a nested module for the namespace TimeStepPrecision
    16     
    17     nested_module = module.add_cpp_namespace('TimeStepPrecision')
    18     register_types_ns3_TimeStepPrecision(nested_module)
    19     
    20     
    21     ## Register a nested module for the namespace Config
    22     
    23     nested_module = module.add_cpp_namespace('Config')
    24     register_types_ns3_Config(nested_module)
    25     
    26     
    27     ## Register a nested module for the namespace olsr
    28     
    29     nested_module = module.add_cpp_namespace('olsr')
    30     register_types_ns3_olsr(nested_module)
    31     
    32 
    33 def register_types_ns3_internal(module):
    34     root_module = module.get_root()
    35     
    36 
    37 def register_types_ns3_TimeStepPrecision(module):
    38     root_module = module.get_root()
    39     
    40 
    41 def register_types_ns3_Config(module):
    42     root_module = module.get_root()
    43     
    44 
    45 def register_types_ns3_olsr(module):
    46     root_module = module.get_root()
    47     
    48 
    49 def register_methods(root_module):
    50     register_Ns3EmuNetDevice_methods(root_module, root_module['ns3::EmuNetDevice'])
    51     return
    52 
    53 def register_Ns3EmuNetDevice_methods(root_module, cls):
    54     ## emu-net-device.h: ns3::EmuNetDevice::EmuNetDevice(ns3::EmuNetDevice const & arg0) [copy constructor]
    55     cls.add_constructor([param('ns3::EmuNetDevice const &', 'arg0')])
    56     ## emu-net-device.h: static ns3::TypeId ns3::EmuNetDevice::GetTypeId() [member function]
    57     cls.add_method('GetTypeId', 
    58                    'ns3::TypeId', 
    59                    [], 
    60                    is_static=True)
    61     ## emu-net-device.h: ns3::EmuNetDevice::EmuNetDevice() [constructor]
    62     cls.add_constructor([])
    63     ## emu-net-device.h: void ns3::EmuNetDevice::SetDataRate(ns3::DataRate bps) [member function]
    64     cls.add_method('SetDataRate', 
    65                    'void', 
    66                    [param('ns3::DataRate', 'bps')])
    67     ## emu-net-device.h: void ns3::EmuNetDevice::SetInterframeGap(ns3::Time t) [member function]
    68     cls.add_method('SetInterframeGap', 
    69                    'void', 
    70                    [param('ns3::Time', 't')])
    71     ## emu-net-device.h: void ns3::EmuNetDevice::Start(ns3::Time tStart) [member function]
    72     cls.add_method('Start', 
    73                    'void', 
    74                    [param('ns3::Time', 'tStart')])
    75     ## emu-net-device.h: void ns3::EmuNetDevice::Stop(ns3::Time tStop) [member function]
    76     cls.add_method('Stop', 
    77                    'void', 
    78                    [param('ns3::Time', 'tStop')])
    79     ## emu-net-device.h: void ns3::EmuNetDevice::SetQueue(ns3::Ptr<ns3::Queue> queue) [member function]
    80     cls.add_method('SetQueue', 
    81                    'void', 
    82                    [param('ns3::Ptr< ns3::Queue >', 'queue')])
    83     ## emu-net-device.h: void ns3::EmuNetDevice::Receive(ns3::Ptr<ns3::Packet> p) [member function]
    84     cls.add_method('Receive', 
    85                    'void', 
    86                    [param('ns3::Ptr< ns3::Packet >', 'p')])
    87     ## emu-net-device.h: void ns3::EmuNetDevice::SetAddress(ns3::Mac48Address addr) [member function]
    88     cls.add_method('SetAddress', 
    89                    'void', 
    90                    [param('ns3::Mac48Address', 'addr')])
    91     ## emu-net-device.h: void ns3::EmuNetDevice::SetName(std::string const name) [member function]
    92     cls.add_method('SetName', 
    93                    'void', 
    94                    [param('std::string const', 'name')], 
    95                    is_virtual=True)
    96     ## emu-net-device.h: std::string ns3::EmuNetDevice::GetName() const [member function]
    97     cls.add_method('GetName', 
    98                    'std::string', 
    99                    [], 
   100                    is_const=True, is_virtual=True)
   101     ## emu-net-device.h: void ns3::EmuNetDevice::SetIfIndex(uint32_t const index) [member function]
   102     cls.add_method('SetIfIndex', 
   103                    'void', 
   104                    [param('uint32_t const', 'index')], 
   105                    is_virtual=True)
   106     ## emu-net-device.h: uint32_t ns3::EmuNetDevice::GetIfIndex() const [member function]
   107     cls.add_method('GetIfIndex', 
   108                    'uint32_t', 
   109                    [], 
   110                    is_const=True, is_virtual=True)
   111     ## emu-net-device.h: ns3::Ptr<ns3::Channel> ns3::EmuNetDevice::GetChannel() const [member function]
   112     cls.add_method('GetChannel', 
   113                    'ns3::Ptr< ns3::Channel >', 
   114                    [], 
   115                    is_const=True, is_virtual=True)
   116     ## emu-net-device.h: ns3::Address ns3::EmuNetDevice::GetAddress() const [member function]
   117     cls.add_method('GetAddress', 
   118                    'ns3::Address', 
   119                    [], 
   120                    is_const=True, is_virtual=True)
   121     ## emu-net-device.h: bool ns3::EmuNetDevice::SetMtu(uint16_t const mtu) [member function]
   122     cls.add_method('SetMtu', 
   123                    'bool', 
   124                    [param('uint16_t const', 'mtu')], 
   125                    is_virtual=True)
   126     ## emu-net-device.h: uint16_t ns3::EmuNetDevice::GetMtu() const [member function]
   127     cls.add_method('GetMtu', 
   128                    'uint16_t', 
   129                    [], 
   130                    is_const=True, is_virtual=True)
   131     ## emu-net-device.h: bool ns3::EmuNetDevice::IsLinkUp() const [member function]
   132     cls.add_method('IsLinkUp', 
   133                    'bool', 
   134                    [], 
   135                    is_const=True, is_virtual=True)
   136     ## emu-net-device.h: void ns3::EmuNetDevice::SetLinkChangeCallback(ns3::Callback<void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> callback) [member function]
   137     cls.add_method('SetLinkChangeCallback', 
   138                    'void', 
   139                    [param('ns3::Callback< void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'callback')], 
   140                    is_virtual=True)
   141     ## emu-net-device.h: bool ns3::EmuNetDevice::IsBroadcast() const [member function]
   142     cls.add_method('IsBroadcast', 
   143                    'bool', 
   144                    [], 
   145                    is_const=True, is_virtual=True)
   146     ## emu-net-device.h: ns3::Address ns3::EmuNetDevice::GetBroadcast() const [member function]
   147     cls.add_method('GetBroadcast', 
   148                    'ns3::Address', 
   149                    [], 
   150                    is_const=True, is_virtual=True)
   151     ## emu-net-device.h: bool ns3::EmuNetDevice::IsMulticast() const [member function]
   152     cls.add_method('IsMulticast', 
   153                    'bool', 
   154                    [], 
   155                    is_const=True, is_virtual=True)
   156     ## emu-net-device.h: ns3::Address ns3::EmuNetDevice::GetMulticast(ns3::Ipv4Address multicastGroup) const [member function]
   157     cls.add_method('GetMulticast', 
   158                    'ns3::Address', 
   159                    [param('ns3::Ipv4Address', 'multicastGroup')], 
   160                    is_const=True, is_virtual=True)
   161     ## emu-net-device.h: bool ns3::EmuNetDevice::IsPointToPoint() const [member function]
   162     cls.add_method('IsPointToPoint', 
   163                    'bool', 
   164                    [], 
   165                    is_const=True, is_virtual=True)
   166     ## emu-net-device.h: bool ns3::EmuNetDevice::Send(ns3::Ptr<ns3::Packet> packet, ns3::Address const & dest, uint16_t protocolNumber) [member function]
   167     cls.add_method('Send', 
   168                    'bool', 
   169                    [param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Address const &', 'dest'), param('uint16_t', 'protocolNumber')], 
   170                    is_virtual=True)
   171     ## emu-net-device.h: bool ns3::EmuNetDevice::SendFrom(ns3::Ptr<ns3::Packet> packet, ns3::Address const & source, ns3::Address const & dest, uint16_t protocolNumber) [member function]
   172     cls.add_method('SendFrom', 
   173                    'bool', 
   174                    [param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Address const &', 'source'), param('ns3::Address const &', 'dest'), param('uint16_t', 'protocolNumber')], 
   175                    is_virtual=True)
   176     ## emu-net-device.h: ns3::Ptr<ns3::Node> ns3::EmuNetDevice::GetNode() const [member function]
   177     cls.add_method('GetNode', 
   178                    'ns3::Ptr< ns3::Node >', 
   179                    [], 
   180                    is_const=True, is_virtual=True)
   181     ## emu-net-device.h: void ns3::EmuNetDevice::SetNode(ns3::Ptr<ns3::Node> node) [member function]
   182     cls.add_method('SetNode', 
   183                    'void', 
   184                    [param('ns3::Ptr< ns3::Node >', 'node')], 
   185                    is_virtual=True)
   186     ## emu-net-device.h: bool ns3::EmuNetDevice::NeedsArp() const [member function]
   187     cls.add_method('NeedsArp', 
   188                    'bool', 
   189                    [], 
   190                    is_const=True, is_virtual=True)
   191     ## emu-net-device.h: void ns3::EmuNetDevice::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]
   192     cls.add_method('SetReceiveCallback', 
   193                    'void', 
   194                    [param('ns3::Callback< bool, ns3::Ptr< ns3::NetDevice >, ns3::Ptr< ns3::Packet const >, unsigned short, ns3::Address const &, ns3::empty, ns3::empty >', 'cb')], 
   195                    is_virtual=True)
   196     ## emu-net-device.h: void ns3::EmuNetDevice::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]
   197     cls.add_method('SetPromiscReceiveCallback', 
   198                    'void', 
   199                    [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')], 
   200                    is_virtual=True)
   201     ## emu-net-device.h: bool ns3::EmuNetDevice::SupportsSendFrom() const [member function]
   202     cls.add_method('SupportsSendFrom', 
   203                    'bool', 
   204                    [], 
   205                    is_const=True, is_virtual=True)
   206     ## emu-net-device.h: void ns3::EmuNetDevice::DoDispose() [member function]
   207     cls.add_method('DoDispose', 
   208                    'void', 
   209                    [], 
   210                    visibility='private', is_virtual=True)
   211     return
   212 
   213 def register_functions(root_module):
   214     module = root_module
   215     register_functions_ns3_internal(module.get_submodule('internal'), root_module)
   216     register_functions_ns3_TimeStepPrecision(module.get_submodule('TimeStepPrecision'), root_module)
   217     register_functions_ns3_Config(module.get_submodule('Config'), root_module)
   218     register_functions_ns3_olsr(module.get_submodule('olsr'), root_module)
   219     return
   220 
   221 def register_functions_ns3_internal(module, root_module):
   222     return
   223 
   224 def register_functions_ns3_TimeStepPrecision(module, root_module):
   225     return
   226 
   227 def register_functions_ns3_Config(module, root_module):
   228     return
   229 
   230 def register_functions_ns3_olsr(module, root_module):
   231     return
   232