wip
Signed-off-by: Benjamin Hesmans <benjamin.hesmans@uclouvain.be>
This commit is contained in:
parent
b3c3cbf522
commit
88e92a76d6
@ -26,22 +26,19 @@ class MpECMPSingleInterfaceTopo(MpTopo):
|
||||
str(link.id))
|
||||
|
||||
def __str__(self):
|
||||
s = "Single if ECMP like env"
|
||||
"""
|
||||
s = "Single if ECMP like env\n"
|
||||
i = 0
|
||||
n = len(self.topoParam.linkCharacteristics)
|
||||
for p in self.topoParam.linkCharacteristics:
|
||||
if i == n // 2:
|
||||
if n % 2 == 0:
|
||||
s = s + "c r-----s\n"
|
||||
s = s + "|-----sw-----|\n"
|
||||
s = s + "c---sw sw-----s\n"
|
||||
s = s + " |-----R-----|\n"
|
||||
else:
|
||||
s = s + "c-----sw-----r-----s\n"
|
||||
s = s + "c---sw----R-----sw-----s\n"
|
||||
else:
|
||||
s = s + "|-----sw-----|\n"
|
||||
s = s + " |-----R-----|\n"
|
||||
|
||||
i = i + 1
|
||||
"""
|
||||
|
||||
return s
|
||||
|
||||
|
@ -8,13 +8,16 @@ class MpTopo:
|
||||
clientName = "Client"
|
||||
serverName = "Server"
|
||||
routerName = "Router"
|
||||
cmdLog = "command.log"
|
||||
|
||||
"""Simple MpTopo"""
|
||||
def __init__(self, topoBuilder, topoParam):
|
||||
self.topoBuilder = topoBuilder
|
||||
self.topoParam = topoParam
|
||||
self.logFile = open(MpTopo.cmdLog, 'w')
|
||||
|
||||
def commandTo(self, who, cmd):
|
||||
self.logFile.write(who.__str__() + " : " + cmd + "\n")
|
||||
self.topoBuilder.commandTo(who, cmd)
|
||||
|
||||
def getHost(self, who):
|
||||
@ -34,6 +37,9 @@ class MpTopo:
|
||||
|
||||
def startNetwork(self):
|
||||
self.topoBuilder.startNetwork()
|
||||
|
||||
def closeLogFile(self):
|
||||
self.logFile.close()
|
||||
|
||||
def stopNetwork(self):
|
||||
self.topoBuilder.stopNetwork()
|
||||
|
Loading…
Reference in New Issue
Block a user