2015-01-06 14:47:15 +00:00
|
|
|
#!/usr/bin/python
|
|
|
|
|
|
|
|
import sys, getopt
|
2015-01-08 11:04:42 +00:00
|
|
|
from mpXpRunner import MpXpRunner
|
|
|
|
from mpTopo import MpTopo
|
2015-01-06 14:47:15 +00:00
|
|
|
|
|
|
|
topoParamFile = None
|
2015-01-08 11:04:42 +00:00
|
|
|
xpParamFile = None
|
|
|
|
topoBuilder = "mininet"
|
2015-01-06 14:47:15 +00:00
|
|
|
|
|
|
|
def printHelp():
|
|
|
|
print("Help Menu")
|
|
|
|
|
|
|
|
def parseArgs(argv):
|
|
|
|
global topoParamFile
|
2015-01-08 11:04:42 +00:00
|
|
|
global xpParamFile
|
2015-01-06 14:47:15 +00:00
|
|
|
try:
|
2015-01-08 11:04:42 +00:00
|
|
|
opts, args = getopt.getopt(argv, "ht:x:", ["topoParam=","xp="])
|
2015-01-06 14:47:15 +00:00
|
|
|
except getopt.GetoptError:
|
|
|
|
printHelp()
|
|
|
|
sys.exit(1)
|
|
|
|
for opt, arg in opts:
|
|
|
|
if opt == "-h":
|
|
|
|
printHelp()
|
|
|
|
sys.exit(1)
|
2015-01-08 11:04:42 +00:00
|
|
|
elif opt in ("-x","--xp"):
|
|
|
|
xpParamFile = arg
|
|
|
|
elif opt in ("-t","--topoParam"):
|
|
|
|
print("hey")
|
2015-01-06 14:47:15 +00:00
|
|
|
topoParamFile = arg
|
2015-01-08 11:04:42 +00:00
|
|
|
if topoParamFile is None:
|
|
|
|
print("Missing the topo...")
|
|
|
|
printHelp()
|
|
|
|
sys.exit(1)
|
2015-01-06 14:47:15 +00:00
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
parseArgs(sys.argv[1:])
|
2015-01-08 11:04:42 +00:00
|
|
|
MpXpRunner(MpTopo.mininetBuilder, topoParamFile, xpParamFile)
|