+08May20=======================================================================
+1. Tidy up routing table
+2. Add new argument to show/version (ALL or list of regexes) that allow you
+ to see the version and build nos of all nodes on the system.
07May20=======================================================================
1. Revert changes made since 25Apr concerning IP address reconciliation.
25Apr20=======================================================================
#
#
+my ($self, $line) = @_;
my @out;
-my ($year) = (gmtime($main::systime))[5];
-$year += 1900;
-push @out, "DX Spider Cluster version $main::version (build $main::build git: $main::gitversion) on \u$^O";
-push @out, "Copyright (c) 1998-$year Dirk Koopman G1TLH";
+my @in = map {uc} split /\s+/, $line;
+
+if ($self->priv > 5 && @in) {
+# $DB::single=1;
+
+ my $q = $in[0] eq 'ALL' ? '.*' : join('|', @in);
+ my @n = sort {$a->call cmp $b->call} grep {$_->call =~ /^(?:$q)/} Route::Node::get_all();
+ push @out, " Node Version Build PC9X via PC92";
+ foreach my $n (@n) {
+ push @out, sprintf " %-10s %5d %5s %3s %3s", $n->call, $n->version, $n->build, yesno($n->do_pc9x), yesno($n->via_pc92);
+ }
+ push @out, ' ' . scalar @n . " Nodes found";
+} else {
+ my ($year) = (gmtime($main::systime))[5];
+ $year += 1900;
+ push @out, "DX Spider Cluster version $main::version (build $main::build git: $main::gitversion) on \u$^O";
+ push @out, "Copyright (c) 1998-$year Dirk Koopman G1TLH";
+}
+
return (1, @out);
--- /dev/null
+#
+# show a Route thingy
+#
+# Copyright (c) 2020 Dirk Koopman G1TLH
+#
+# A general purpose Route get thingy, use stat/route_user or _node if
+# you want a list of all that particular type of thingy otherwise this
+# is likely to be less typing and will dwym.
+#
+
+my ($self, $line) = @_;
+my @out;
+my @list = split /\s+/, $line; # generate a list of callsigns
+
+push @list, $self->call unless @list;
+
+foreach my $call (@list) {
+ $call = uc $call;
+ my $ref = Route::get($call);
+ if ($ref) {
+ push @out, print_all_fields($self, $ref, "Route::User Information $call");
+ } else {
+ push @out, "Route: $call not found";
+ }
+ push @out, "" if @list > 1;
+}
+
+return (1, @out);
my ($self, $line) = @_;
my @out;
my @list = split /\s+/, $line; # generate a list of callsigns
-@list = ($self->call) if !@list; # my channel if no callsigns
+@list = ($self->call) unless @list; # my channel if no callsigns
if ($self->priv > 5 && @list && uc $list[0] eq 'ALL') {
push @out, "Node Callsigns in Routing Table";
@list = sort map {$_->call} Route::Node::get_all();
my @rout;
# remove spurious IPV6 prefix on IPV4 addresses
- $ip =~ s/^::ffff://;
+ $ip =~ s/^::ffff:// if $ip;
if ($call) {
my $ncall = $parent->call;
my $ref = shift;
my $out;
for (sort keys %$ref) {
- $out .= "$_=$ref->{$_}, ";
+ $out .= "$_=" . atime($ref->{$_}) . ", ";
}
chop $out;
chop $out;
use vars qw(%list %valid $filterdef $maxlevel);
%valid = (
+ parent => '0,Parent Calls,parray',
call => "0,Callsign",
flags => "0,Flags,phex",
dxcc => '0,Country Code',
cq => '0,CQ Zone',
state => '0,State',
city => '0,City',
+ ip => '0,IP Address',
);
$filterdef = bless ([
@ISA = qw(Route);
%valid = (
- parent => '0,Parent Calls,parray',
nodes => '0,Nodes,parray',
users => '0,Users,parray',
usercount => '0,User Count',
lastmsg => '0,Last Route Msg,atime',
lastid => '0,Last Route MsgID',
do_pc9x => '0,Uses pc9x,yesno',
- via_pc92 => '0,Came in via pc92,yesno',
+ via_pc92 => '0,In via pc92?,yesno',
obscount => '0,Obscount',
last_PC92C => '9,Last PC92C',
- PC92C_dxchan => '9,Channel of PC92C,phash',
- ip => '0,IP Address',
+ PC92C_dxchan => '9,PC92C hops,phash',
);
$filterdef = $Route::filterdef;
use vars qw(%list %valid @ISA $max $filterdef);
@ISA = qw(Route);
-%valid = (
- parent => '0,Parent Calls,parray',
- ip => '0,IP Address',
-);
-
$filterdef = $Route::filterdef;
%list = ();
$max = 0;
my $desc = $repo->command_oneline(['describe', '--long'], STDERR => 0);
if ($desc) {
my ($v, $s, $b, $g) = $desc =~ /^([\d.]+)(?:\.(\d+))?-(\d+)-g([0-9a-f]+)/;
+ $s ||= '';
+ dbg("Git: $desc");
+ dbg("Git: V=$v S=$s B=$b g=$g");
$version = $v;
$build = $b || 0;
$gitversion = "$g\[r]";