本文整理汇总了Python中mininet.net.Mininet.init方法的典型用法代码示例。如果您正苦于以下问题:Python Mininet.init方法的具体用法?Python Mininet.init怎么用?Python Mininet.init使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mininet.net.Mininet
的用法示例。
在下文中一共展示了Mininet.init方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: myNet
# 需要导入模块: from mininet.net import Mininet [as 别名]
# 或者: from mininet.net.Mininet import init [as 别名]
def myNet():
Mininet.init()
info( "*** Creating nodes\n" )
net = Mininet( topo=CustomTopo(3))
net.start()
CLI(net)
net.stop()
示例2: exit
# 需要导入模块: from mininet.net import Mininet [as 别名]
# 或者: from mininet.net.Mininet import init [as 别名]
print "Please run this script as root / use sudo."
exit(-1)
lg.setLogLevel( 'info')
description = "Put Stanford backbone in Mininet"
parser = ArgumentParser(description=description)
parser.add_argument("-c", dest="controller_name",
default="localhost",
help="Controller's hostname or IP")
parser.add_argument("-p", dest="controller_port",type=int,
default=6633,
help="Controller's port")
parser.add_argument("-c2", dest="dummy_controller_name",
default="localhost",
help="Dummy controller's hostname or IP")
parser.add_argument("-p2", dest="dummy_controller_port",type=int,
default=6633,
help="Dummy ontroller's port")
parser.add_argument("-num", dest="controller_number",type=int,
default=2,
help="the number of the controller")
args = parser.parse_args()
print description
print "Starting with primary controller %s:%d" % (args.controller_name, args.controller_port)
# print "Starting with dummy controller %s:%d" % (args.dummy_controller_name, args.dummy_controller_port)
print "starting %s controllers in this network" %args.controller_number
Mininet.init()
StanfordTopoTest(gethostbyname(args.controller_name), args.controller_port, args.controller_number)
topos = { 'mininetbuilder': ( lambda: StanfordTopo() ) }