def findSwitchRoute():
pathKey = ""
nodeList = []
src = int(switch[h2].split(":",7)[7],16)
dst = int(switch[h1].split(":",7)[7],16)
print src
print dst
for currentPath in nx.all_shortest_paths(G, source=src, target=dst, weight=None):
for node in currentPath:
tmp = ""
if node < 17:
pathKey = pathKey + "0" + str(hex(node)).split("x",1)[1] + "::"
tmp = "00:00:00:00:00:00:00:0" + str(hex(node)).split("x",1)[1]
else:
pathKey = pathKey + str(hex(node)).split("x",1)[1] + "::"
tmp = "00:00:00:00:00:00:00:" + str(hex(node)).split("x",1)[1]
nodeList.append(tmp)
pathKey=pathKey.strip("::")
path[pathKey] = nodeList
pathKey = ""
nodeList = []
print path
# Computes Link TX
评论列表
文章目录