当前位置: 首页>>代码示例>>Python>>正文


Python Controller.__init__方法代码示例

本文整理汇总了Python中mininet.node.Controller.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python Controller.__init__方法的具体用法?Python Controller.__init__怎么用?Python Controller.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在mininet.node.Controller的用法示例。


在下文中一共展示了Controller.__init__方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: from mininet.node import Controller [as 别名]
# 或者: from mininet.node.Controller import __init__ [as 别名]
 def __init__(self, name, cdir=FAUCET_DIR,
              command='ryu-manager faucet.py',
              cargs='--ofp-tcp-listen-port=%s --verbose --use-stderr',
              **kwargs):
     Controller.__init__(self, name, cdir=cdir,
                         command=command,
                         cargs=cargs, **kwargs)
开发者ID:KitL,项目名称:faucet,代码行数:9,代码来源:faucet_mininet_test.py

示例2: __init__

# 需要导入模块: from mininet.node import Controller [as 别名]
# 或者: from mininet.node.Controller import __init__ [as 别名]
    def __init__(self, name,
                 command='java -jar ' + fl_root_dir + 'target/floodlight.jar',
                 cargs='',
                 ip='127.0.0.1',
                 **kwargs):
        # Check to make sure Floodlight is installed before moving forward.
        installFloodlight()

        # Increment the number of controller instances for naming purposes.
        Floodlight.controller_number += 1

        # Initialize attributes
        self.name = name
        self.properties_path = ''
        self.properties_file = ''

        self.createUniqueFloodlightPropertiesFile()

        # Create the command that will start Floodlight, including the path to the unique properties file.
        self.command = command + ' -cf ' + self.properties_path + self.properties_file

        # Initialize the parent class.
        Controller.__init__(self, name, cdir=self.fl_root_dir,
                            command=self.command,
                            cargs=cargs, ip=ip, **kwargs)
开发者ID:OpenFlow-Clemson,项目名称:EAGERProject,代码行数:27,代码来源:floodlight.py

示例3: __init__

# 需要导入模块: from mininet.node import Controller [as 别名]
# 或者: from mininet.node.Controller import __init__ [as 别名]
 def __init__( self, name, ip=CONTROLLER_IP, port=6633, **kwargs):
     """Init.
        name: name to give controller
        ip: the IP address where the remote controller is
        listening
        port: the port where the remote controller is listening"""
     Controller.__init__( self, name, ip=ip, port=port, **kwargs )
开发者ID:opennetworkinglab,项目名称:spring-open,代码行数:9,代码来源:fat_tree.py

示例4: __init__

# 需要导入模块: from mininet.node import Controller [as 别名]
# 或者: from mininet.node.Controller import __init__ [as 别名]
 def __init__( self, name, n=1, reactive=True, runAsRoot=False, **params):
     """n: number of ONOS instances to run (1)
        reactive: run in reactive mode (True)
        runAsRoot: run ONOS as root (False)"""
     self.check()
     self.count = n
     self.reactive = reactive
     self.runAsRoot = runAsRoot
     self.ids = range( 0, self.count )
     Controller.__init__( self, name, **params )
     self.proxies = []
     # We don't need to run as root, and it can interfere
     # with starting Zookeeper manually
     self.user = None
     if not self.runAsRoot:
         try:
             self.user = quietRun( 'who am i' ).split()[ 0 ]
             self.sendCmd( 'su', self.user )
             self.waiting = False
         except:
             warn( '__init__: failed to drop privileges\n' )
     self.cmd( 'mkdir -p', self.logDir )
     # Need to run commands from ONOS dir
     self.cmd( 'cd', self.onosDir )
     self.cmd( 'export PATH=$PATH:%s' % self.onosDir )
开发者ID:opennetworkinglab,项目名称:spring-open,代码行数:27,代码来源:onos.py

示例5: __init__

# 需要导入模块: from mininet.node import Controller [as 别名]
# 或者: from mininet.node.Controller import __init__ [as 别名]
 def __init__(self, name, cdir = POXDIR,
              command = 'python pox-debug.py',
              # cargs = ('openflow.of_01 --port=%s forwarding.l2_learning'),
              cargs = 'forwarding.l2_learning openflow.of_01 --port=%s',
              **kwargs):
     Controller.__init__(self, name, cdir = cdir,
                         command = command,
                         cargs = cargs, **kwargs)
开发者ID:netixx,项目名称:mininet-NetProbes,代码行数:10,代码来源:builder.py

示例6: __init__

# 需要导入模块: from mininet.node import Controller [as 别名]
# 或者: from mininet.node.Controller import __init__ [as 别名]
 def __init__( self, name, **kwargs ):
     "alertAction: exception|ignore|warn|exit (exception)"
     kwargs.update( inNamespace=True )
     self.alertAction = kwargs.pop( 'alertAction', 'exception' )
     Controller.__init__( self, name, **kwargs )
     self.dir = '/tmp/%s' % self.name
     self.client = self.dir + '/karaf/bin/client'
     self.ONOS_HOME = '/tmp'
开发者ID:maheshraju-Huawei,项目名称:actn,代码行数:10,代码来源:onos.py

示例7: __init__

# 需要导入模块: from mininet.node import Controller [as 别名]
# 或者: from mininet.node.Controller import __init__ [as 别名]
 def __init__( self, name, cdir=MAPLEDIR,
               command='/home/vagrant/.maple/lib/maple',
               cargs=( '-u /vagrant/classes -l %s SP '),
               **kwargs):
     Controller.__init__( self, name, cdir=cdir,
                          command=command,
                          cargs=cargs, **kwargs )
     print command, cargs
开发者ID:snlab,项目名称:utilities,代码行数:10,代码来源:ysn_8.py

示例8: __init__

# 需要导入模块: from mininet.node import Controller [as 别名]
# 或者: from mininet.node.Controller import __init__ [as 别名]
    def __init__(self, name, cdir=POXDIR, command='python pox.py',
                 cargs='openflow.of_01 --port=%s', **kwargs):
        if 'script' in kwargs:
            cargs += ' ' + kwargs['script']
        else:
            cargs += ' forwarding.l2_learning'

        Controller.__init__(self, name, cdir=cdir, command=command, cargs=cargs, **kwargs)
开发者ID:bolek117,项目名称:mininet_sdn,代码行数:10,代码来源:pox.py

示例9: __init__

# 需要导入模块: from mininet.node import Controller [as 别名]
# 或者: from mininet.node.Controller import __init__ [as 别名]
 def __init__(self, name, cdir=FLDIR,
              command='java -jar target/floodlight.jar',
              cargs='',
              ip='127.0.0.1',
              port=6653,
              **kwargs):
     Controller.__init__(self, name, cdir=cdir,
                         command=command,
                         cargs=cargs, ip=ip, port=port, **kwargs)
开发者ID:cbarrin,项目名称:MininetScripts,代码行数:11,代码来源:floodlight.py

示例10: __init__

# 需要导入模块: from mininet.node import Controller [as 别名]
# 或者: from mininet.node.Controller import __init__ [as 别名]
    def __init__( self, name, cdir=POXDIR,
                  command='python pox.py',
			  
                  cargs=( 'openflow.of_01 --port=%s '
			  'tests.controller' ),
                  **kwargs ):
        Controller.__init__( self, name, cdir=cdir,
                             command=command,
                             cargs=cargs, **kwargs )
开发者ID:rakeshgn31,项目名称:SDN_Project,代码行数:11,代码来源:custcontroller.py

示例11: __init__

# 需要导入模块: from mininet.node import Controller [as 别名]
# 或者: from mininet.node.Controller import __init__ [as 别名]
 def __init__(
     self,
     name,
     cdir=faucet_mininet_test_util.FAUCET_DIR,
     command="timeout 180s ryu-manager gauge.py",
     cargs="--ofp-tcp-listen-port=%s --verbose --use-stderr",
     **kwargs
 ):
     name = "gauge-%u" % os.getpid()
     Controller.__init__(self, name, cdir=cdir, command=command, cargs=cargs, **kwargs)
开发者ID:REANNZ,项目名称:faucet,代码行数:12,代码来源:faucet_mininet_test_base.py

示例12: __init__

# 需要导入模块: from mininet.node import Controller [as 别名]
# 或者: from mininet.node.Controller import __init__ [as 别名]
 def __init__( self, name, inNamespace=False, command='controller',
              cargs='-v ptcp:%d', cdir=None, ip="127.0.0.1",
              port=6633, **params ):
     """command: controller command name
        cargs: controller command arguments
        cdir: director to cd to before running controller
        ip: IP address for controller
        port: port for controller to listen at
        params: other params passed to Node.__init__()"""
     Controller.__init__( self, name, ip=ip, port=port, **params)
开发者ID:petergrabowski,项目名称:networks,代码行数:12,代码来源:lab3.py

示例13: __init__

# 需要导入模块: from mininet.node import Controller [as 别名]
# 或者: from mininet.node.Controller import __init__ [as 别名]
 def __init__(self,
              name,
              cdir=CURRENT_DIR,
              command='./pox-wrapper.py',
              cargs=('controller.loop_discovery --port=%s --file=pox.log'),
              **kwargs):
     Controller.__init__(self,
                         name,
                         cdir=cdir,
                         command=command,
                         cargs=cargs,
                         **kwargs)
开发者ID:butjar,项目名称:pox-playground,代码行数:14,代码来源:ring.py

示例14: __init__

# 需要导入模块: from mininet.node import Controller [as 别名]
# 或者: from mininet.node.Controller import __init__ [as 别名]
 def __init__(self,
              name,
              command='ryu-manager {0}/faucet.py test_api.py'.format(
                 faucet_mininet_test_util.FAUCET_DIR),
              cargs='--ofp-tcp-listen-port=%s --verbose --use-stderr',
              **kwargs):
     name = 'faucet-api-%u' % os.getpid()
     Controller.__init__(
         self,
         name,
         command=command,
         cargs=cargs,
         **kwargs)
开发者ID:Baloc,项目名称:faucet,代码行数:15,代码来源:faucet_mininet_test_base.py

示例15: __init__

# 需要导入模块: from mininet.node import Controller [as 别名]
# 或者: from mininet.node.Controller import __init__ [as 别名]
    def __init__(self, name, *poxArgs, **kwargs):
        """Init.
           name: name to give controller
           poxArgs: arguments (strings) to pass to POX"""
        if not poxArgs:
            warn('warning: no POX modules specified; '
                  'running packetdump only\n')
            poxArgs = ['packetdump']
        elif type(poxArgs) not in (list, tuple):
            poxArgs = [poxArgs]

        Controller.__init__(self, name,
                             command=POX_DIR + '/pox.py',
                             cargs='--libdir=/usr/local/lib -v -i ptcp:%s ' +
                             ' '.join(poxArgs),
                             cdir=POX_DIR,
                             **kwargs)
开发者ID:ZubairNabi,项目名称:minerva,代码行数:19,代码来源:mininet_setup.py


注:本文中的mininet.node.Controller.__init__方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。