本文整理汇总了Python中mininet.net.Mininet.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python Mininet.__init__方法的具体用法?Python Mininet.__init__怎么用?Python Mininet.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mininet.net.Mininet
的用法示例。
在下文中一共展示了Mininet.__init__方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from mininet.net import Mininet [as 别名]
# 或者: from mininet.net.Mininet import __init__ [as 别名]
def __init__( self, *args, **kwargs ):
"""servers: a list of servers to use (note: include
localhost or None to use local system as well)
user: user name for server ssh
placement: Placer() subclass"""
params = { 'host': RemoteHost,
'switch': RemoteOVSSwitch,
'link': RemoteLink,
'precheck': True }
params.update( kwargs )
servers = params.pop( 'servers', [ 'localhost' ] )
servers = [ s if s else 'localhost' for s in servers ]
self.servers = servers
self.serverIP = params.pop( 'serverIP', {} )
if not self.serverIP:
self.serverIP = { server: RemoteMixin.findServerIP( server )
for server in self.servers }
self.user = params.pop( 'user', findUser() )
if params.pop( 'precheck' ):
self.precheck()
self.connections = {}
self.placement = params.pop( 'placement', SwitchBinPlacer )
# Make sure control directory exists
self.cdir = os.environ[ 'HOME' ] + '/.ssh/mn'
errRun( [ 'mkdir', '-p', self.cdir ] )
Mininet.__init__( self, *args, **params )
示例2: __init__
# 需要导入模块: from mininet.net import Mininet [as 别名]
# 或者: from mininet.net.Mininet import __init__ [as 别名]
def __init__( self, controllers=[], gratuitousArp=True, build=True, *args, **kwargs ):
"""Create Mininet object for ONOS.
controllers: List of controller IP addresses
gratuitousArp: Send an ARP from each host to aid controller's host discovery"""
# discarding provided controller (if any),
# using list of remote controller IPs instead
kwargs[ 'controller' ] = None
# delay building for a second
kwargs[ 'build' ] = False
Mininet.__init__(self, *args, **kwargs )
self.gratArp = gratuitousArp
self.useArping = ONOSMininet.useArping
info ( '*** Adding controllers\n' )
ctrl_count = 0
for controllerIP in controllers:
self.addController( 'c%d' % ctrl_count, RemoteController, ip=controllerIP )
info( ' c%d (%s)\n' % ( ctrl_count, controllerIP ) )
ctrl_count = ctrl_count + 1
if self.topo and build:
self.build()
示例3: __init__
# 需要导入模块: from mininet.net import Mininet [as 别名]
# 或者: from mininet.net.Mininet import __init__ [as 别名]
def __init__(self, *pargs, **kwargs):
#extra args support
self.service_factory = None
self.service_flag = kwargs.pop('services', None)
if self.service_flag:
self.service_factory = mnServices()
Mininet.__init__(self, *pargs, **kwargs)
示例4: __init__
# 需要导入模块: from mininet.net import Mininet [as 别名]
# 或者: from mininet.net.Mininet import __init__ [as 别名]
def __init__(self, **args):
global controllerIp, controllerPort, configFileName
self.topo = TestbedTopo()
args['topo'] = self.topo
args['switch'] = OVSKernelSwitch
args['controller'] = RemoteController
args['build'] = False
Mininet.__init__(self, **args)
self.ctrl = self.addController( 'c0', controller=RemoteController, ip=controllerIp, port=controllerPort)
示例5: __init__
# 需要导入模块: from mininet.net import Mininet [as 别名]
# 或者: from mininet.net.Mininet import __init__ [as 别名]
def __init__(self, tableIP, verbose=False):
Mininet.__init__(self, build=False)
self.tableIP = tableIP
self.vsfs = []
self.rootnodes = []
self.verbose = verbose
lg.setLogLevel('info')
self.name_to_root_nodes = {}
self.node_to_pw_data = defaultdict(list)
示例6: __init__
# 需要导入模块: from mininet.net import Mininet [as 别名]
# 或者: from mininet.net.Mininet import __init__ [as 别名]
def __init__( self, topo=None, switch=OVSKernelSwitch, host=Host,
controller=Controller, link=Link, intf=Intf,
build=True, xterms=False, cleanup=False, ipBase='10.0.0.0/8',
inNamespace=False,
autoSetMacs=False, autoStaticArp=False, autoPinCpus=False,
listenPort=None ):
self.ccnNetBase = '1.0.0.0'
Mininet.__init__( self, topo, switch, host, controller, link, intf,
build, xterms, cleanup, ipBase, inNamespace,
autoSetMacs, autoStaticArp, autoPinCpus, listenPort )
示例7: __init__
# 需要导入模块: from mininet.net import Mininet [as 别名]
# 或者: from mininet.net.Mininet import __init__ [as 别名]
def __init__(self, verbose=False):
self.checkPATHs()
Mininet.__init__(self, build=False)
self.cr_oshis = []
self.pe_oshis = []
self.ce_routers = []
self.ctrls = []
self.nodes_in_rn = []
self.node_to_data = defaultdict(list)
self.node_to_node = {}
self.node_to_default_via = {}
self.coex = {}
self.verbose = verbose
lg.setLogLevel('info')
self.vlls = []
self.node_to_pw_data = defaultdict(list)
self.pws = []
self.cer_to_customer = {}
self.customer_to_vtepallocator = {}
self.vsfs = []
self.pe_cer_to_vsf = {}
self.is_vs = False
self.vss = []
self.vss_data = []
self.id_peo_to_vs = {}
self.last_ipnet = IPv4Network(u'0.0.0.0/24')
self.id_to_node = {}
self.ip_to_mac = {}
self.overall_info = {}
self.mgmt = None
root = Node( 'root', inNamespace=False )
root.cmd('/etc/init.d/network-manager stop')
mylog("*** Stop Network Manager\n")
self.cluster_to_ctrl = defaultdict(list)
self.cluster_to_nodes = defaultdict(list)
self.nodes_to_cluster = {}
示例8: __init__
# 需要导入模块: from mininet.net import Mininet [as 别名]
# 或者: from mininet.net.Mininet import __init__ [as 别名]
def __init__( self, **params ):
"""Mininet set up to test barrier transactions with one client
and a specified number of servers.
numberOfServers: number of servers
linkBandwidth: link bandwidth in Mb/s
roundTripTime: unloaded round trip time from client to server, in microseconds"""
host = custom( CPULimitedHost, cpu=cpuShare() )
link = custom( TCLink, bw=args.bandwidth, delay=delay() )
Mininet.__init__(
self,
topo=BarrierTransactionTopo( **params ),
host=host,
link=link )
示例9: __init__
# 需要导入模块: from mininet.net import Mininet [as 别名]
# 或者: from mininet.net.Mininet import __init__ [as 别名]
def __init__(self, *pargs, **kwargs):
Mininet.__init__(self, *pargs, **kwargs)
self.services = {}
示例10: __init__
# 需要导入模块: from mininet.net import Mininet [as 别名]
# 或者: from mininet.net.Mininet import __init__ [as 别名]
def __init__( self ):
Mininet.__init__( self, switch=OVSSwitch, controller=RemoteController )
self.servers = [] # list of server nodes
self.httpd = {} # dict of HTTP listener processes
开发者ID:danishaer,项目名称:Software-Defined-Networking--Implementation-in-JAVA--OSGi-,代码行数:6,代码来源:mininet5.py
示例11: __init__
# 需要导入模块: from mininet.net import Mininet [as 别名]
# 或者: from mininet.net.Mininet import __init__ [as 别名]
def __init__(self, config_path=None, **params):
self.config_path = LINC_CONFIG if config_path is None else config_path
Mininet.__init__(self, **params)
示例12: __init__
# 需要导入模块: from mininet.net import Mininet [as 别名]
# 或者: from mininet.net.Mininet import __init__ [as 别名]
def __init__(self, *args, **kwargs):
info("** Using Mininet Extended (MiniNExT) Handler\n")
Mininet.__init__(self, *args, **kwargs)