got routing essentially working
[spider.git] / cmd / show / configuration.pl
1 #
2 # show the cluster routing tables to the user
3 #
4 # Copyright (c) 1998 Dirk Koopman G1TLH
5 #
6 # $Id$
7 #
8
9 my ($self, $line) = @_;
10 my @list = map { uc } split /\s+/, $line;           # list of callsigns of nodes
11 my @out;
12 my @nodes = (DXNode::get_all());
13 my $node;
14
15 push @out, "Node         Callsigns";
16 foreach $node (@nodes) {
17   if (@list) {
18     next if !grep $node->call eq $_, @list;
19   }
20   my $i = 0;
21   my @l;
22   my $call = $node->call;
23   $call = "($call)" if $node->here == 0;
24   push @l, $call;
25   my $nlist = $node->list;
26   my @val = values %{$nlist};
27   foreach $call (@val) {
28     if ($i >= 5) {
29           push @out, sprintf "%-12s %-12s %-12s %-12s %-12s %-12s", @l;
30           @l = ();
31           push @l, "";
32           $i = 0;
33         }
34         my $s = $call->{call};
35         $s = sprintf "(%s)", $s if $call->{here} == 0;
36         push @l, $s;
37         $i++;
38   }
39   push @out, sprintf "%-12s %-12s %-12s %-12s %-12s %-12s", @l;
40 }
41
42
43 return (1, @out);