Mercurial > hg > anonet-resdb
comparison doc/ucis.ano/bgp_graph/path_list_to_dot.php @ 35:bec289fc3b4a draft
attempt at testing AS names
author | Nick <nick@somerandomnick.ano> |
---|---|
date | Fri, 11 Jun 2010 19:58:52 +0000 |
parents | e429d8af6e44 |
children | 14e97bffdd55 |
comparison
equal
deleted
inserted
replaced
34:e429d8af6e44 | 35:bec289fc3b4a |
---|---|
20 foreach ($links as $link => $dummy) { | 20 foreach ($links as $link => $dummy) { |
21 if ($node != $link && isset($nodes[$node][$link]) && isset($nodes[$link][$node])) unset($nodes[$link][$node]); | 21 if ($node != $link && isset($nodes[$node][$link]) && isset($nodes[$link][$node])) unset($nodes[$link][$node]); |
22 } | 22 } |
23 } | 23 } |
24 | 24 |
25 function nodename ($node) { switch ($node) { | |
26 case '64731': return 'SRN'; | |
27 }; return $node; }; | |
28 | |
29 $nodelist=array(); | |
30 foreach ($nodes as $node => $links) { | |
31 if (!array_key_exists($node,$nodelist)) $nodelist[$node]=nodename($node); | |
32 foreach ($links as $link => $dummy) | |
33 if (!array_key_exists($link,$nodelist)) $nodelist[$node]=nodename($link); | |
34 }; | |
35 | |
36 foreach ($nodelist as $node => $name) | |
37 print "\t".$node.' [label="'.$name.'"]'."\n"; | |
38 | |
25 print("graph BGP_nodes {\n"); | 39 print("graph BGP_nodes {\n"); |
26 foreach ($nodes as $node => $links) { | 40 foreach ($nodes as $node => $links) { |
27 foreach ($links as $link => $dummy) { | 41 foreach ($links as $link => $dummy) { |
28 print("\t".$node.' -- '.$link.";\n"); | 42 print("\t".$node.' -- '.$link.";\n"); |
29 } | 43 } |