本文整理汇总了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)
示例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)
示例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 )
示例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 )
示例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)
示例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'
示例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
示例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)
示例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)
示例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 )
示例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)
示例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)
示例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)
示例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)
示例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)