add an RBN line to progress
[spider.git] / cmd / links.pl
index 8856ba2703a6dd1ad6ae92c5148881d795ea0b3d..f35545577dce2dd9f78eff231af216ed1428eb3c 100644 (file)
@@ -15,8 +15,8 @@ my $dxchan;
 my @out;
 my $nowt = time;
 
-push @out, "                                      Ave  Obs  Ping  Next      Filters";
-push @out, "  Callsign Type Started               RTT Count Int.  Ping Iso? In  Out PC92? Address";
+push @out, "                                                  Ave  Obs  Ping  Next      Filters";
+push @out, "  Callsign Type Started                 Uptime    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();
@@ -27,8 +27,9 @@ foreach $dxchan ( sort {$a->call cmp $b->call} DXChannel::get_all_nodes ) {
        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 $ping = $dxchan->is_node && $dxchan != $main::me ? sprintf("%7.2f",$dxchan->pingave) : "";
        my $iso = $dxchan->isolate ? 'Y' :' ';
+       my $uptime = difft($dxchan->startt, 1);
        my ($fin, $fout, $pc92) = (' ', ' ', ' ');
        if ($dxchan->do_pc9x) {
                $pc92 = 'Y';
@@ -46,7 +47,6 @@ foreach $dxchan ( sort {$a->call cmp $b->call} DXChannel::get_all_nodes ) {
                $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;
@@ -54,14 +54,14 @@ foreach $dxchan ( sort {$a->call cmp $b->call} DXChannel::get_all_nodes ) {
        $sort = "AK1A" if $dxchan->is_ak1a;
        my $ipaddr;
 
-       if ($dxchan->conn->peerhost) {
-               my $addr = $dxchan->conn->peerhost;
-               $ipaddr = $addr if is_ipaddr($addr);
+       my $addr = $dxchan->hostname;
+       if ($addr) {
+           $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;
+       push @out, sprintf "%10s $sort $t%13s$ping   $obscount  %5d %5d  $iso    $fin   $fout   $pc92    $ipaddr", $call, $uptime ,$pingint, $lastt;
 }
 
 return (1, @out)