xentaur

changeset 39:54b7c7ae50ec

brodge-bridge link visualisation
author igor
date Fri Sep 28 13:35:54 2007 +0300 (2007-09-28)
parents f71b298798c2
children 10444acb35f4
files examples/example1.py shapes/all/linux.png shapes/all/macosx.png shapes/all/windows.png xentaur.py
line diff
     1.1 --- a/examples/example1.py	Fri Sep 28 13:03:15 2007 +0300
     1.2 +++ b/examples/example1.py	Fri Sep 28 13:35:54 2007 +0300
     1.3 @@ -3,8 +3,8 @@
     1.4  
     1.5  network='netw'
     1.6  
     1.7 -domains =       [ 'qua1',   'qua2',   'dyn3',     'qua4',   'qua5',   'dyn6',    'cisco1', 'cisco2' ]
     1.8 -domain_types =  [ 'quagga', 'quagga', 'xenomips', 'quagga', 'quagga', 'xenomips','cisco',  'cisco' ]
     1.9 +domains =       [ 'qua1',   'qua2',   'dyn3',     'qua4',   'qua5',   'dyn6',    'cisco1', 'linux1', 'windows1', 'mac1' ]
    1.10 +domain_types =  [ 'quagga', 'quagga', 'xenomips', 'quagga', 'quagga', 'xenomips','cisco',  'linux',  'windows', 'macosx' ]
    1.11  bridges =       [
    1.12                    'br1',
    1.13                    'br2',
    1.14 @@ -13,25 +13,31 @@
    1.15                    'br5',
    1.16                    'br6',
    1.17                    'cat1',
    1.18 +                  'cat2',
    1.19                  ]
    1.20  
    1.21  vbridges_table ={
    1.22 -                  'qua1'    : [ 'br1' ],
    1.23 -		  'qua2'    : [ 'br2', 'br5' ],
    1.24 -		  'dyn3'    : [ 'br1', 'br2', 'br3' ],
    1.25 -		  'qua4'    : [ 'br3', 'br4', 'br6' ],
    1.26 -		  'qua5'    : [ 'br4' ],
    1.27 -		  'dyn6'    : [ 'br5',  'br6' ],
    1.28 -  
    1.29 -            'cisco1' : ['br6','cat1'],
    1.30 -            'cisco2' : ['br6','cat1'],
    1.31 -		  }
    1.32 +        'qua1'    : [ 'br1' ],
    1.33 +        'qua2'    : [ 'br2', 'br5' ],
    1.34 +        'dyn3'    : [ 'br1', 'br2', 'br3' ],
    1.35 +        'qua4'    : [ 'br3', 'br4', 'br6' ],
    1.36 +        'qua5'    : [ 'br4' ],
    1.37 +        'dyn6'    : [ 'br5',  'br6' ],
    1.38 +        'cisco1' : ['br6','cat1'],
    1.39 +        'linux1' : ['cat1'],
    1.40 +        'windows1'  : ['cat1'],
    1.41 +        'mac1'      : ['cat1'],
    1.42 +}
    1.43 +
    1.44 +bridge_bridge_table = {
    1.45 +    'cat2' : [ 'br1' ],
    1.46 +}
    1.47  
    1.48  hidden_bridges = []
    1.49  broken_links = []
    1.50  temporary_links = []
    1.51  
    1.52 -real_bridges=['cat1']
    1.53 +real_bridges=['cat1', 'cat2']
    1.54  real_nodes=['cisco1','cisco2']
    1.55  
    1.56  N=domains.index(domain)
     2.1 Binary file shapes/all/linux.png has changed
     3.1 Binary file shapes/all/macosx.png has changed
     4.1 Binary file shapes/all/windows.png has changed
     5.1 --- a/xentaur.py	Fri Sep 28 13:03:15 2007 +0300
     5.2 +++ b/xentaur.py	Fri Sep 28 13:35:54 2007 +0300
     5.3 @@ -124,10 +124,6 @@
     5.4              if not [ host, bridges_raw.index(this_bridge), this_bridge ] in temporary_links:
     5.5                  links.append(host+" -- "+this_bridge+" [taillabel=\"fa"+str(bridges_raw.index(this_bridge))+"/0\"]")
     5.6                  i+=1
     5.7 -       #         if [ host, this_bridge ] in broken_links:
     5.8 -       #             links.append(host+" -- "+this_bridge+" [taillabel=\"fa"+str(i)+"/0\",style=dashed]")
     5.9 -       #         else:
    5.10 -       #             links.append(host+" -- "+this_bridge+" [taillabel=\"fa"+str(i)+"/0\"]")
    5.11  
    5.12      for link in temporary_links:
    5.13          links.append(link[0]+" -- "+link[2]+" [taillabel=\"fa"+str(link[1])+"/0\",color=blue,len=10,w=5,weight=5]")
    5.14 @@ -135,6 +131,19 @@
    5.15      for link in broken_links:
    5.16          links.append(link[0]+" -- "+link[2]+" [taillabel=\"fa"+str(link[1])+"/0\",style=dashed]")
    5.17  
    5.18 +
    5.19 +    # bridge-bridge links
    5.20 +    for host, bridges_raw in bridge_bridge_table.iteritems():
    5.21 +        i=0
    5.22 +        for this_bridge in bridges_raw:
    5.23 +            if this_bridge in hidden_bridges or not this_bridge:
    5.24 +                continue 
    5.25 +            if not [ host, bridges_raw.index(this_bridge), this_bridge ] in temporary_links:
    5.26 +                links.append(host+" -- "+this_bridge)
    5.27 +                i+=1
    5.28 +
    5.29 +
    5.30 +
    5.31      linklist=";\n    ".join(links)
    5.32  
    5.33      graph_dot = {