annotate doc/ucis.ano/bgp_graph/path_list_to_xml.php @ 1236:4291c23e1fba
draft
Merge branch 'master' of http://git.volatile.ano/wowaname/resdb
author |
epoch <epoch@hack.thebackupbox.net> |
date |
Thu, 05 Sep 2019 02:13:25 +0000 |
parents |
4dbe5bf653bb |
children |
|
rev |
line source |
28
|
1 #!/usr/bin/php |
|
2 <?php |
|
3 $nodes = array(); |
|
4 |
|
5 $file = STDIN; |
|
6 |
|
7 while (!feof($file)) { |
|
8 $line = stream_get_line($file, 1024, "\n"); |
|
9 if ($line === NULL) break; |
|
10 if (!strlen($line)) continue; |
|
11 $pathnodes = explode(' ', $line); |
|
12 $prevnode = NULL; |
|
13 foreach ($pathnodes as $node) { |
|
14 if ($node && $prevnode) print('<link from="'.$node.'" to="'.$prevnode.'" total="1" />'."\n"); |
|
15 $prevnode = $node; |
|
16 } |
|
17 } |