2015-01-06 14:47:15 +00:00
|
|
|
class MpTopo:
|
2015-01-08 11:04:42 +00:00
|
|
|
mininetBuilder = "mininet"
|
|
|
|
multiIfTopo = "MultiIf"
|
|
|
|
topoAttr = "topoType"
|
2015-01-07 13:44:44 +00:00
|
|
|
switchNamePrefix = "s"
|
|
|
|
clientName = "Client"
|
|
|
|
serverName = "Server"
|
|
|
|
routerName = "Router"
|
|
|
|
|
2015-01-06 14:47:15 +00:00
|
|
|
"""Simple MpTopo"""
|
|
|
|
def __init__(self, topoBuilder, topoParam):
|
|
|
|
self.topoBuilder = topoBuilder
|
|
|
|
self.topoParam = topoParam
|
|
|
|
|
|
|
|
def commandTo(self, who, cmd):
|
2015-01-07 13:44:44 +00:00
|
|
|
self.topoBuilder.commandTo(who, cmd)
|
2015-01-06 14:47:15 +00:00
|
|
|
|
|
|
|
def getHost(self, who):
|
2015-01-07 13:44:44 +00:00
|
|
|
return self.topoBuilder.getHost(who)
|
2015-01-06 14:47:15 +00:00
|
|
|
|
|
|
|
def addHost(self, host):
|
2015-01-07 13:44:44 +00:00
|
|
|
return self.topoBuilder.addHost(host)
|
2015-01-06 14:47:15 +00:00
|
|
|
|
|
|
|
def addSwitch(self, switch):
|
2015-01-07 13:44:44 +00:00
|
|
|
return self.topoBuilder.addSwitch(switch)
|
2015-01-06 14:47:15 +00:00
|
|
|
|
|
|
|
def addLink(self, fromA, toB, **kwargs):
|
|
|
|
self.topoBuilder.addLink(fromA,toB,**kwargs)
|
|
|
|
|
2015-01-07 13:44:44 +00:00
|
|
|
def getCLI(self):
|
|
|
|
self.topoBuilder.getCLI()
|
|
|
|
|
|
|
|
def startNetwork(self):
|
|
|
|
self.topoBuilder.startNetwork()
|
|
|
|
|
|
|
|
def stopNetwork(self):
|
|
|
|
self.topoBuilder.stopNetwork()
|