# HG changeset patch # User igor # Date 1190975754 -10800 # Node ID 54b7c7ae50ec5edbb011f960e0f3723b73c2fbc4 # Parent f71b298798c26eaab5485ca28f3f110be93f0320 brodge-bridge link visualisation diff -r f71b298798c2 -r 54b7c7ae50ec examples/example1.py --- a/examples/example1.py Fri Sep 28 13:03:15 2007 +0300 +++ b/examples/example1.py Fri Sep 28 13:35:54 2007 +0300 @@ -3,8 +3,8 @@ network='netw' -domains = [ 'qua1', 'qua2', 'dyn3', 'qua4', 'qua5', 'dyn6', 'cisco1', 'cisco2' ] -domain_types = [ 'quagga', 'quagga', 'xenomips', 'quagga', 'quagga', 'xenomips','cisco', 'cisco' ] +domains = [ 'qua1', 'qua2', 'dyn3', 'qua4', 'qua5', 'dyn6', 'cisco1', 'linux1', 'windows1', 'mac1' ] +domain_types = [ 'quagga', 'quagga', 'xenomips', 'quagga', 'quagga', 'xenomips','cisco', 'linux', 'windows', 'macosx' ] bridges = [ 'br1', 'br2', @@ -13,25 +13,31 @@ 'br5', 'br6', 'cat1', + 'cat2', ] vbridges_table ={ - 'qua1' : [ 'br1' ], - 'qua2' : [ 'br2', 'br5' ], - 'dyn3' : [ 'br1', 'br2', 'br3' ], - 'qua4' : [ 'br3', 'br4', 'br6' ], - 'qua5' : [ 'br4' ], - 'dyn6' : [ 'br5', 'br6' ], - - 'cisco1' : ['br6','cat1'], - 'cisco2' : ['br6','cat1'], - } + 'qua1' : [ 'br1' ], + 'qua2' : [ 'br2', 'br5' ], + 'dyn3' : [ 'br1', 'br2', 'br3' ], + 'qua4' : [ 'br3', 'br4', 'br6' ], + 'qua5' : [ 'br4' ], + 'dyn6' : [ 'br5', 'br6' ], + 'cisco1' : ['br6','cat1'], + 'linux1' : ['cat1'], + 'windows1' : ['cat1'], + 'mac1' : ['cat1'], +} + +bridge_bridge_table = { + 'cat2' : [ 'br1' ], +} hidden_bridges = [] broken_links = [] temporary_links = [] -real_bridges=['cat1'] +real_bridges=['cat1', 'cat2'] real_nodes=['cisco1','cisco2'] N=domains.index(domain) diff -r f71b298798c2 -r 54b7c7ae50ec shapes/all/linux.png Binary file shapes/all/linux.png has changed diff -r f71b298798c2 -r 54b7c7ae50ec shapes/all/macosx.png Binary file shapes/all/macosx.png has changed diff -r f71b298798c2 -r 54b7c7ae50ec shapes/all/windows.png Binary file shapes/all/windows.png has changed diff -r f71b298798c2 -r 54b7c7ae50ec xentaur.py --- a/xentaur.py Fri Sep 28 13:03:15 2007 +0300 +++ b/xentaur.py Fri Sep 28 13:35:54 2007 +0300 @@ -124,10 +124,6 @@ if not [ host, bridges_raw.index(this_bridge), this_bridge ] in temporary_links: links.append(host+" -- "+this_bridge+" [taillabel=\"fa"+str(bridges_raw.index(this_bridge))+"/0\"]") i+=1 - # if [ host, this_bridge ] in broken_links: - # links.append(host+" -- "+this_bridge+" [taillabel=\"fa"+str(i)+"/0\",style=dashed]") - # else: - # links.append(host+" -- "+this_bridge+" [taillabel=\"fa"+str(i)+"/0\"]") for link in temporary_links: links.append(link[0]+" -- "+link[2]+" [taillabel=\"fa"+str(link[1])+"/0\",color=blue,len=10,w=5,weight=5]") @@ -135,6 +131,19 @@ for link in broken_links: links.append(link[0]+" -- "+link[2]+" [taillabel=\"fa"+str(link[1])+"/0\",style=dashed]") + + # bridge-bridge links + for host, bridges_raw in bridge_bridge_table.iteritems(): + i=0 + for this_bridge in bridges_raw: + if this_bridge in hidden_bridges or not this_bridge: + continue + if not [ host, bridges_raw.index(this_bridge), this_bridge ] in temporary_links: + links.append(host+" -- "+this_bridge) + i+=1 + + + linklist=";\n ".join(links) graph_dot = {