6. make set/isolate and acc/route mutually exclusive (and issue appropriate
[spider.git] / cmd / stat / route_node.pl
1 #
2 # show a Route::Node thingy
3 #
4 # Copyright (c) 2001 Dirk Koopman G1TLH
5 #
6 # $Id$
7 #
8
9 my ($self, $line) = @_;
10 my @out;
11 my @list = split /\s+/, $line;                # generate a list of callsigns
12 @list = ($self->call) if !@list;  # my channel if no callsigns
13 if ($self->priv > 5 && @list && uc $list[0] eq 'ALL') {
14         push @out, "Node Callsigns in Routing Table";
15         @list = sort map {$_->call} Route::Node::get_all();
16         my $count = @list;
17         my $n = int $self->width / 10;
18         $n ||= 8;
19         while (@list > $n) {
20                 push @out, join(' ', map {sprintf "%9s",$_ } splice(@list, 0, $n));
21         } 
22         push @out, join(' ', map {sprintf "%9s",$_ } @list) if @list;
23         push @out, "$count Nodes";
24         return (1, @out);
25 }
26
27 my $call;
28 foreach $call (@list) {
29   $call = uc $call;
30   my $ref = Route::Node::get($call);
31   if ($ref) {
32     @out = print_all_fields($self, $ref, "Route::Node Information $call");
33   } else {
34     push @out, "Route::Node: $call not found";
35   }
36   push @out, "" if @list > 1;
37 }
38
39 return (1, @out);