Mercurial > hg > anonet-resdb
changeset 51:198bd6e327eb draft
added some more customization capability for ASN names
author | Nick <nick@somerandomnick.ano> |
---|---|
date | Mon, 14 Jun 2010 02:42:56 +0000 |
parents | 0e7ba1239f5a |
children | 8643d1b779de |
files | doc/ucis.ano/bgp_graph/path_list_to_dot.php |
diffstat | 1 files changed, 12 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/doc/ucis.ano/bgp_graph/path_list_to_dot.php Mon Jun 14 02:04:24 2010 +0000 +++ b/doc/ucis.ano/bgp_graph/path_list_to_dot.php Mon Jun 14 02:42:56 2010 +0000 @@ -23,16 +23,24 @@ } function static_nodename ($node) { switch ($node) { - case '64731': return 'SRN (AS64731)'; - case '64766': return 'UFO (AS64766)'; +// case '64731': return 'SRN (AS64731)'; +// case '64766': return 'UFO (AS64766)'; +}; return NULL; }; + +function nodenickname ($node) { switch ($node) { + case '64731': return 'SRN'; + case '64766': return 'UFO'; }; return NULL; }; function nodename ($node) { $node=preg_replace('/[^0-9]+/','',$node); if (($name=static_nodename($node))!==NULL) return $name; + $nameparts=array(); + if (($nick=nodenickname($node))!==NULL) $nameparts[]=$nick; $name=rtrim(`echo $node | ./asn2adminc | ./hdl2person`); - if (empty($name)) return 'AS'.$node; -return 'AS'.$node.' ('.$name.')'; }; + if (empty($name)) $name='AS'.$node; else $name="AS$node ($name)"; + $nameparts[]=$name; +return join(' - ',$nameparts); }; $nodelist=array(); foreach ($nodes as $node => $links) {