1 #!/usr/bin/perl
2
3 open(GRAPHVIZ, "|dot -Tps > graph.ps");
4
5 print GRAPHVIZ "graph test {\n";
6
7 for ($i = 1; $i < 100; $i++) {
8 next unless open(NEIGHBORS, "/dev/sim/$i/link/0/neighbors");
9
10 while (<NEIGHBORS>) {
11 next unless /active/;
12
13 ($id) = split;
14
15 print GRAPHVIZ "$i -- $id;\n";
16 }
17
18 close(NEIGHBORS);
19 }
20
21 print GRAPHVIZ "}\n";
22
23 close(GRPAHVIZ);
24 print "output written to graph.ps\n";
25
This page was automatically generated by the
LXR engine.
Visit the LXR main site for more
information.