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
|
2015-01-08 18:52:45 +00:00
|
|
|
self.topoParam = topoParam
|
2015-01-06 14:47:15 +00:00
|
|
|
|
|
|
|
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()
|