Mercurial > hg > anonet-resdb
view doc/ucis.ano/bgp_graph/path_list_to_xml.php @ 498:7ad8b0d24cd1 draft
Updating faq.pod for a2.o with new IPv6 info
author | lex <lex@lynx.ano> |
---|---|
date | Mon, 09 May 2011 23:49:39 +0000 |
parents | 4dbe5bf653bb |
children |
line wrap: on
line source
#!/usr/bin/php <?php $nodes = array(); $file = STDIN; while (!feof($file)) { $line = stream_get_line($file, 1024, "\n"); if ($line === NULL) break; if (!strlen($line)) continue; $pathnodes = explode(' ', $line); $prevnode = NULL; foreach ($pathnodes as $node) { if ($node && $prevnode) print('<link from="'.$node.'" to="'.$prevnode.'" total="1" />'."\n"); $prevnode = $node; } }