bindings/python/ns3_module_global_routing.py
author Tom Henderson <tomh@tomh.org>
Thu, 28 May 2009 21:38:49 -0700
changeset 4474 19e2b7ff3482
parent 4454 f2af91ee09e7
child 4616 a84f60b6cd12
permissions -rw-r--r--
bindings/ changes for IPv4 routing rework
     1 from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers
     2 
     3 def register_types(module):
     4     root_module = module.get_root()
     5     
     6     ## global-route-manager.h: ns3::GlobalRouteManager [class]
     7     module.add_class('GlobalRouteManager')
     8     ## global-router-interface.h: ns3::GlobalRoutingLSA [class]
     9     module.add_class('GlobalRoutingLSA')
    10     ## global-router-interface.h: ns3::GlobalRoutingLSA::LSType [enumeration]
    11     module.add_enum('LSType', ['Unknown', 'RouterLSA', 'NetworkLSA', 'SummaryLSA', 'SummaryLSA_ASBR', 'ASExternalLSAs'], outer_class=root_module['ns3::GlobalRoutingLSA'])
    12     ## global-router-interface.h: ns3::GlobalRoutingLSA::SPFStatus [enumeration]
    13     module.add_enum('SPFStatus', ['LSA_SPF_NOT_EXPLORED', 'LSA_SPF_CANDIDATE', 'LSA_SPF_IN_SPFTREE'], outer_class=root_module['ns3::GlobalRoutingLSA'])
    14     ## global-router-interface.h: ns3::GlobalRoutingLinkRecord [class]
    15     module.add_class('GlobalRoutingLinkRecord')
    16     ## global-router-interface.h: ns3::GlobalRoutingLinkRecord::LinkType [enumeration]
    17     module.add_enum('LinkType', ['Unknown', 'PointToPoint', 'TransitNetwork', 'StubNetwork', 'VirtualLink'], outer_class=root_module['ns3::GlobalRoutingLinkRecord'])
    18     ## global-router-interface.h: ns3::GlobalRouter [class]
    19     module.add_class('GlobalRouter', is_singleton=True, parent=root_module['ns3::Object'])
    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 TimeStepPrecision
    28     
    29     nested_module = module.add_cpp_namespace('TimeStepPrecision')
    30     register_types_ns3_TimeStepPrecision(nested_module)
    31     
    32     
    33     ## Register a nested module for the namespace addressUtils
    34     
    35     nested_module = module.add_cpp_namespace('addressUtils')
    36     register_types_ns3_addressUtils(nested_module)
    37     
    38     
    39     ## Register a nested module for the namespace internal
    40     
    41     nested_module = module.add_cpp_namespace('internal')
    42     register_types_ns3_internal(nested_module)
    43     
    44     
    45     ## Register a nested module for the namespace olsr
    46     
    47     nested_module = module.add_cpp_namespace('olsr')
    48     register_types_ns3_olsr(nested_module)
    49     
    50 
    51 def register_types_ns3_Config(module):
    52     root_module = module.get_root()
    53     
    54 
    55 def register_types_ns3_TimeStepPrecision(module):
    56     root_module = module.get_root()
    57     
    58 
    59 def register_types_ns3_addressUtils(module):
    60     root_module = module.get_root()
    61     
    62 
    63 def register_types_ns3_internal(module):
    64     root_module = module.get_root()
    65     
    66 
    67 def register_types_ns3_olsr(module):
    68     root_module = module.get_root()
    69     
    70 
    71 def register_methods(root_module):
    72     register_Ns3GlobalRouteManager_methods(root_module, root_module['ns3::GlobalRouteManager'])
    73     register_Ns3GlobalRoutingLSA_methods(root_module, root_module['ns3::GlobalRoutingLSA'])
    74     register_Ns3GlobalRoutingLinkRecord_methods(root_module, root_module['ns3::GlobalRoutingLinkRecord'])
    75     register_Ns3GlobalRouter_methods(root_module, root_module['ns3::GlobalRouter'])
    76     return
    77 
    78 def register_Ns3GlobalRouteManager_methods(root_module, cls):
    79     ## global-route-manager.h: static void ns3::GlobalRouteManager::PopulateRoutingTables() [member function]
    80     cls.add_method('PopulateRoutingTables', 
    81                    'void', 
    82                    [], 
    83                    is_static=True)
    84     ## global-route-manager.h: static void ns3::GlobalRouteManager::PopulateRoutingTables(ns3::NodeContainer c) [member function]
    85     cls.add_method('PopulateRoutingTables', 
    86                    'void', 
    87                    [param('ns3::NodeContainer', 'c')], 
    88                    is_static=True)
    89     ## global-route-manager.h: static void ns3::GlobalRouteManager::RecomputeRoutingTables() [member function]
    90     cls.add_method('RecomputeRoutingTables', 
    91                    'void', 
    92                    [], 
    93                    is_static=True)
    94     ## global-route-manager.h: static void ns3::GlobalRouteManager::DeleteGlobalRoutes() [member function]
    95     cls.add_method('DeleteGlobalRoutes', 
    96                    'void', 
    97                    [], 
    98                    is_static=True)
    99     ## global-route-manager.h: static void ns3::GlobalRouteManager::SelectRouterNodes() [member function]
   100     cls.add_method('SelectRouterNodes', 
   101                    'void', 
   102                    [], 
   103                    is_static=True)
   104     ## global-route-manager.h: static void ns3::GlobalRouteManager::SelectRouterNodes(ns3::NodeContainer c) [member function]
   105     cls.add_method('SelectRouterNodes', 
   106                    'void', 
   107                    [param('ns3::NodeContainer', 'c')], 
   108                    is_static=True)
   109     ## global-route-manager.h: static uint32_t ns3::GlobalRouteManager::AllocateRouterId() [member function]
   110     cls.add_method('AllocateRouterId', 
   111                    'uint32_t', 
   112                    [], 
   113                    is_static=True)
   114     return
   115 
   116 def register_Ns3GlobalRoutingLSA_methods(root_module, cls):
   117     cls.add_output_stream_operator()
   118     ## global-router-interface.h: ns3::GlobalRoutingLSA::GlobalRoutingLSA() [constructor]
   119     cls.add_constructor([])
   120     ## global-router-interface.h: ns3::GlobalRoutingLSA::GlobalRoutingLSA(ns3::GlobalRoutingLSA::SPFStatus status, ns3::Ipv4Address linkStateId, ns3::Ipv4Address advertisingRtr) [constructor]
   121     cls.add_constructor([param('ns3::GlobalRoutingLSA::SPFStatus', 'status'), param('ns3::Ipv4Address', 'linkStateId'), param('ns3::Ipv4Address', 'advertisingRtr')])
   122     ## global-router-interface.h: ns3::GlobalRoutingLSA::GlobalRoutingLSA(ns3::GlobalRoutingLSA & lsa) [constructor]
   123     cls.add_constructor([param('ns3::GlobalRoutingLSA &', 'lsa')])
   124     ## global-router-interface.h: uint32_t ns3::GlobalRoutingLSA::AddAttachedRouter(ns3::Ipv4Address addr) [member function]
   125     cls.add_method('AddAttachedRouter', 
   126                    'uint32_t', 
   127                    [param('ns3::Ipv4Address', 'addr')])
   128     ## global-router-interface.h: uint32_t ns3::GlobalRoutingLSA::AddLinkRecord(ns3::GlobalRoutingLinkRecord * lr) [member function]
   129     cls.add_method('AddLinkRecord', 
   130                    'uint32_t', 
   131                    [param('ns3::GlobalRoutingLinkRecord *', 'lr')])
   132     ## global-router-interface.h: void ns3::GlobalRoutingLSA::ClearLinkRecords() [member function]
   133     cls.add_method('ClearLinkRecords', 
   134                    'void', 
   135                    [])
   136     ## global-router-interface.h: void ns3::GlobalRoutingLSA::CopyLinkRecords(ns3::GlobalRoutingLSA const & lsa) [member function]
   137     cls.add_method('CopyLinkRecords', 
   138                    'void', 
   139                    [param('ns3::GlobalRoutingLSA const &', 'lsa')])
   140     ## global-router-interface.h: ns3::Ipv4Address ns3::GlobalRoutingLSA::GetAdvertisingRouter() const [member function]
   141     cls.add_method('GetAdvertisingRouter', 
   142                    'ns3::Ipv4Address', 
   143                    [], 
   144                    is_const=True)
   145     ## global-router-interface.h: ns3::Ipv4Address ns3::GlobalRoutingLSA::GetAttachedRouter(uint32_t n) const [member function]
   146     cls.add_method('GetAttachedRouter', 
   147                    'ns3::Ipv4Address', 
   148                    [param('uint32_t', 'n')], 
   149                    is_const=True)
   150     ## global-router-interface.h: ns3::GlobalRoutingLSA::LSType ns3::GlobalRoutingLSA::GetLSType() const [member function]
   151     cls.add_method('GetLSType', 
   152                    'ns3::GlobalRoutingLSA::LSType', 
   153                    [], 
   154                    is_const=True)
   155     ## global-router-interface.h: ns3::GlobalRoutingLinkRecord * ns3::GlobalRoutingLSA::GetLinkRecord(uint32_t n) const [member function]
   156     cls.add_method('GetLinkRecord', 
   157                    'ns3::GlobalRoutingLinkRecord *', 
   158                    [param('uint32_t', 'n')], 
   159                    is_const=True)
   160     ## global-router-interface.h: ns3::Ipv4Address ns3::GlobalRoutingLSA::GetLinkStateId() const [member function]
   161     cls.add_method('GetLinkStateId', 
   162                    'ns3::Ipv4Address', 
   163                    [], 
   164                    is_const=True)
   165     ## global-router-interface.h: uint32_t ns3::GlobalRoutingLSA::GetNAttachedRouters() const [member function]
   166     cls.add_method('GetNAttachedRouters', 
   167                    'uint32_t', 
   168                    [], 
   169                    is_const=True)
   170     ## global-router-interface.h: uint32_t ns3::GlobalRoutingLSA::GetNLinkRecords() const [member function]
   171     cls.add_method('GetNLinkRecords', 
   172                    'uint32_t', 
   173                    [], 
   174                    is_const=True)
   175     ## global-router-interface.h: ns3::Ipv4Mask ns3::GlobalRoutingLSA::GetNetworkLSANetworkMask() const [member function]
   176     cls.add_method('GetNetworkLSANetworkMask', 
   177                    'ns3::Ipv4Mask', 
   178                    [], 
   179                    is_const=True)
   180     ## global-router-interface.h: ns3::GlobalRoutingLSA::SPFStatus ns3::GlobalRoutingLSA::GetStatus() const [member function]
   181     cls.add_method('GetStatus', 
   182                    'ns3::GlobalRoutingLSA::SPFStatus', 
   183                    [], 
   184                    is_const=True)
   185     ## global-router-interface.h: bool ns3::GlobalRoutingLSA::IsEmpty() const [member function]
   186     cls.add_method('IsEmpty', 
   187                    'bool', 
   188                    [], 
   189                    is_const=True)
   190     ## global-router-interface.h: void ns3::GlobalRoutingLSA::Print(std::ostream & os) const [member function]
   191     cls.add_method('Print', 
   192                    'void', 
   193                    [param('std::ostream &', 'os')], 
   194                    is_const=True)
   195     ## global-router-interface.h: void ns3::GlobalRoutingLSA::SetAdvertisingRouter(ns3::Ipv4Address rtr) [member function]
   196     cls.add_method('SetAdvertisingRouter', 
   197                    'void', 
   198                    [param('ns3::Ipv4Address', 'rtr')])
   199     ## global-router-interface.h: void ns3::GlobalRoutingLSA::SetLSType(ns3::GlobalRoutingLSA::LSType typ) [member function]
   200     cls.add_method('SetLSType', 
   201                    'void', 
   202                    [param('ns3::GlobalRoutingLSA::LSType', 'typ')])
   203     ## global-router-interface.h: void ns3::GlobalRoutingLSA::SetLinkStateId(ns3::Ipv4Address addr) [member function]
   204     cls.add_method('SetLinkStateId', 
   205                    'void', 
   206                    [param('ns3::Ipv4Address', 'addr')])
   207     ## global-router-interface.h: void ns3::GlobalRoutingLSA::SetNetworkLSANetworkMask(ns3::Ipv4Mask mask) [member function]
   208     cls.add_method('SetNetworkLSANetworkMask', 
   209                    'void', 
   210                    [param('ns3::Ipv4Mask', 'mask')])
   211     ## global-router-interface.h: void ns3::GlobalRoutingLSA::SetStatus(ns3::GlobalRoutingLSA::SPFStatus status) [member function]
   212     cls.add_method('SetStatus', 
   213                    'void', 
   214                    [param('ns3::GlobalRoutingLSA::SPFStatus', 'status')])
   215     return
   216 
   217 def register_Ns3GlobalRoutingLinkRecord_methods(root_module, cls):
   218     ## global-router-interface.h: ns3::GlobalRoutingLinkRecord::GlobalRoutingLinkRecord(ns3::GlobalRoutingLinkRecord const & arg0) [copy constructor]
   219     cls.add_constructor([param('ns3::GlobalRoutingLinkRecord const &', 'arg0')])
   220     ## global-router-interface.h: ns3::GlobalRoutingLinkRecord::GlobalRoutingLinkRecord() [constructor]
   221     cls.add_constructor([])
   222     ## global-router-interface.h: ns3::GlobalRoutingLinkRecord::GlobalRoutingLinkRecord(ns3::GlobalRoutingLinkRecord::LinkType linkType, ns3::Ipv4Address linkId, ns3::Ipv4Address linkData, uint16_t metric) [constructor]
   223     cls.add_constructor([param('ns3::GlobalRoutingLinkRecord::LinkType', 'linkType'), param('ns3::Ipv4Address', 'linkId'), param('ns3::Ipv4Address', 'linkData'), param('uint16_t', 'metric')])
   224     ## global-router-interface.h: ns3::Ipv4Address ns3::GlobalRoutingLinkRecord::GetLinkId() const [member function]
   225     cls.add_method('GetLinkId', 
   226                    'ns3::Ipv4Address', 
   227                    [], 
   228                    is_const=True)
   229     ## global-router-interface.h: void ns3::GlobalRoutingLinkRecord::SetLinkId(ns3::Ipv4Address addr) [member function]
   230     cls.add_method('SetLinkId', 
   231                    'void', 
   232                    [param('ns3::Ipv4Address', 'addr')])
   233     ## global-router-interface.h: ns3::Ipv4Address ns3::GlobalRoutingLinkRecord::GetLinkData() const [member function]
   234     cls.add_method('GetLinkData', 
   235                    'ns3::Ipv4Address', 
   236                    [], 
   237                    is_const=True)
   238     ## global-router-interface.h: void ns3::GlobalRoutingLinkRecord::SetLinkData(ns3::Ipv4Address addr) [member function]
   239     cls.add_method('SetLinkData', 
   240                    'void', 
   241                    [param('ns3::Ipv4Address', 'addr')])
   242     ## global-router-interface.h: ns3::GlobalRoutingLinkRecord::LinkType ns3::GlobalRoutingLinkRecord::GetLinkType() const [member function]
   243     cls.add_method('GetLinkType', 
   244                    'ns3::GlobalRoutingLinkRecord::LinkType', 
   245                    [], 
   246                    is_const=True)
   247     ## global-router-interface.h: void ns3::GlobalRoutingLinkRecord::SetLinkType(ns3::GlobalRoutingLinkRecord::LinkType linkType) [member function]
   248     cls.add_method('SetLinkType', 
   249                    'void', 
   250                    [param('ns3::GlobalRoutingLinkRecord::LinkType', 'linkType')])
   251     ## global-router-interface.h: uint16_t ns3::GlobalRoutingLinkRecord::GetMetric() const [member function]
   252     cls.add_method('GetMetric', 
   253                    'uint16_t', 
   254                    [], 
   255                    is_const=True)
   256     ## global-router-interface.h: void ns3::GlobalRoutingLinkRecord::SetMetric(uint16_t metric) [member function]
   257     cls.add_method('SetMetric', 
   258                    'void', 
   259                    [param('uint16_t', 'metric')])
   260     return
   261 
   262 def register_Ns3GlobalRouter_methods(root_module, cls):
   263     ## global-router-interface.h: static ns3::TypeId ns3::GlobalRouter::GetTypeId() [member function]
   264     cls.add_method('GetTypeId', 
   265                    'ns3::TypeId', 
   266                    [], 
   267                    is_static=True)
   268     ## global-router-interface.h: ns3::GlobalRouter::GlobalRouter() [constructor]
   269     cls.add_constructor([])
   270     ## global-router-interface.h: ns3::Ipv4Address ns3::GlobalRouter::GetRouterId() const [member function]
   271     cls.add_method('GetRouterId', 
   272                    'ns3::Ipv4Address', 
   273                    [], 
   274                    is_const=True)
   275     ## global-router-interface.h: uint32_t ns3::GlobalRouter::DiscoverLSAs() [member function]
   276     cls.add_method('DiscoverLSAs', 
   277                    'uint32_t', 
   278                    [])
   279     ## global-router-interface.h: uint32_t ns3::GlobalRouter::GetNumLSAs() const [member function]
   280     cls.add_method('GetNumLSAs', 
   281                    'uint32_t', 
   282                    [], 
   283                    is_const=True)
   284     ## global-router-interface.h: bool ns3::GlobalRouter::GetLSA(uint32_t n, ns3::GlobalRoutingLSA & lsa) const [member function]
   285     cls.add_method('GetLSA', 
   286                    'bool', 
   287                    [param('uint32_t', 'n'), param('ns3::GlobalRoutingLSA &', 'lsa')], 
   288                    is_const=True)
   289     ## global-router-interface.h: void ns3::GlobalRouter::DoDispose() [member function]
   290     cls.add_method('DoDispose', 
   291                    'void', 
   292                    [], 
   293                    visibility='private', is_virtual=True)
   294     return
   295 
   296 def register_functions(root_module):
   297     module = root_module
   298     register_functions_ns3_Config(module.get_submodule('Config'), root_module)
   299     register_functions_ns3_TimeStepPrecision(module.get_submodule('TimeStepPrecision'), root_module)
   300     register_functions_ns3_addressUtils(module.get_submodule('addressUtils'), root_module)
   301     register_functions_ns3_internal(module.get_submodule('internal'), root_module)
   302     register_functions_ns3_olsr(module.get_submodule('olsr'), root_module)
   303     return
   304 
   305 def register_functions_ns3_Config(module, root_module):
   306     return
   307 
   308 def register_functions_ns3_TimeStepPrecision(module, root_module):
   309     return
   310 
   311 def register_functions_ns3_addressUtils(module, root_module):
   312     return
   313 
   314 def register_functions_ns3_internal(module, root_module):
   315     return
   316 
   317 def register_functions_ns3_olsr(module, root_module):
   318     return
   319