got routing essentially working
[spider.git] / cmd / show / users.pl
1 #
2 # show the users on this cluster from the routing tables
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 $node = (DXNode->get($main::mycall));
13
14 push @out, "Callsigns connected to $main::mycall";
15 my $call;
16 my $i = 0;
17 my @l;
18 my $nlist = $node->list;
19 my @val = values %{$nlist};
20 foreach $call (@val) {
21   if (@list) {
22     next if !grep $call->call eq $_, @list;
23   } 
24   if ($i >= 5) {
25     push @out, sprintf "%-12s %-12s %-12s %-12s %-12s %-12s", @l;
26         @l = ();
27         $i = 0;
28   }
29   my $s = $call->{call};
30   $s = sprintf "(%s)", $s if $call->{here} == 0;
31   push @l, $s;
32   $i++;
33 }
34 push @out, sprintf "%-12s %-12s %-12s %-12s %-12s %-12s", @l;
35
36
37 return (1, @out);
38