X-Git-Url: http://dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=cmd%2Flinks.pl;h=8856ba2703a6dd1ad6ae92c5148881d795ea0b3d;hb=0c963c43ab1cc4028eb79e366d5c0cfa4575b057;hp=648ebba43909eb4348ab4411ede5f5ea1dcada87;hpb=29ec5bb85c591182dd868e7a3d87f510d7b47e9b;p=spider.git diff --git a/cmd/links.pl b/cmd/links.pl index 648ebba4..8856ba27 100644 --- a/cmd/links.pl +++ b/cmd/links.pl @@ -4,30 +4,64 @@ # # Created by Iain Philipps G0RDI, based entirely on # who.pl, which is Copyright (c) 1999 Dirk Koopman G1TLH +# and subsequently plagerized by K1XX. # # 16-Jun-2000 -# $Id: links.pl +# # my $self = shift; my $dxchan; my @out; +my $nowt = time; -push @out, " Callsign Type Started Ave RTT"; +push @out, " Ave Obs Ping Next Filters"; +push @out, " Callsign Type Started RTT Count Int. Ping Iso? In Out PC92? Address"; foreach $dxchan ( sort {$a->call cmp $b->call} DXChannel::get_all_nodes ) { my $call = $dxchan->call(); + next if $dxchan == $main::me; my $t = cldatetime($dxchan->startt); my $sort; my $name = $dxchan->user->name || " "; - my $ping = $dxchan->is_node && $dxchan != $DXProt::me ? sprintf("%8.2f", - $dxchan->pingave) : ""; + my $obscount = $dxchan->nopings; + my $pingint = $dxchan->pingint; + my $lastt = $dxchan->lastping ? ($dxchan->pingint - ($nowt - $dxchan->lastping)) : $pingint; + my $ping = $dxchan->is_node && $dxchan != $main::me ? sprintf("%8.2f",$dxchan->pingave) : ""; + my $iso = $dxchan->isolate ? 'Y' :' '; + my ($fin, $fout, $pc92) = (' ', ' ', ' '); + if ($dxchan->do_pc9x) { + $pc92 = 'Y'; + } else { + my $f; + if ($f = $dxchan->inroutefilter) { + $fin = $dxchan->inroutefilter =~ /node_default/ ? 'D' : 'Y'; + } + if ($f = $dxchan->routefilter) { + $fout = $dxchan->routefilter =~ /node_default/ ? 'D' : 'Y'; + } + } + unless ($pingint) { + $lastt = 0; + $ping = " "; + } + + $sort = 'ANEA' if $dxchan->is_aranea; $sort = "DXSP" if $dxchan->is_spider; $sort = "CLX " if $dxchan->is_clx; $sort = "DXNT" if $dxchan->is_dxnet; $sort = "AR-C" if $dxchan->is_arcluster; $sort = "AK1A" if $dxchan->is_ak1a; - push @out, sprintf "%10s $sort $t $ping", $call; + my $ipaddr; + + if ($dxchan->conn->peerhost) { + my $addr = $dxchan->conn->peerhost; + $ipaddr = $addr if is_ipaddr($addr); + $ipaddr = 'local' if $addr =~ /^127\./ || $addr =~ /^::[0-9a-f]+$/; + } + $ipaddr = 'ax25' if $dxchan->conn->ax25; + + push @out, sprintf "%10s $sort $t$ping $obscount %5d %5d $iso $fin $fout $pc92 $ipaddr", $call, $pingint, $lastt; } return (1, @out)