change interface to Route::findroutes
authorDirk Koopman <djk@tobit.co.uk>
Tue, 24 Jun 2008 21:22:44 +0000 (22:22 +0100)
committerDirk Koopman <djk@tobit.co.uk>
Tue, 24 Jun 2008 21:22:44 +0000 (22:22 +0100)
This change allows things like sh/route to obtain the actual
routing priorities either for use or display.

Add a command 'send_config' to broadcast a new PC92 C record
to all interfaces. Useful for playig catchup more quickly after
a restart.

cmd/Commands_en.hlp
cmd/send_config.pl [new file with mode: 0644]
cmd/show/route.pl
perl/Route.pm
perl/Version.pm

index a7a829963c659fc4f80dc420b950606672c51855..99413b3f1c5e3ddedfd423972ff13b448aaa9d22 100644 (file)
@@ -1385,6 +1385,12 @@ This will show YOU the output from SH/VHFTABLE and also store it in the
 message. 
 
 You can carry on with the message until you are ready to send it. 
+
+=== 6^SEND_CONFIG^Broadcast PC92 C records
+This is the PC92 equivalent of INIT. In that it will send out a new
+PC92 C record to all interfaces. This can be used to bring other nodes
+up to date quicker after a restart.
+
 === 0^SET/ADDRESS <your address>^Record your postal address
 
 === 9^SET/AGWENGINE^Enable the AGW Engine
diff --git a/cmd/send_config.pl b/cmd/send_config.pl
new file mode 100644 (file)
index 0000000..75916d3
--- /dev/null
@@ -0,0 +1,10 @@
+#
+# send out PC92 config records manually
+#
+
+my $self = shift;
+return (1, $self->msg('e5')) unless $self->priv > 5;
+
+$main::me->broadcast_pc92_update($main::mycall);
+
+return (1, $self->msg('ok'));
index c927e8dc265c4d55ed9a7bcf7604888ad0145249..d055e61694a01995f9245395fc42651545917bcc 100644 (file)
@@ -17,7 +17,9 @@ foreach $l (@list) {
        my $ref = Route::get($l);
        if ($ref) {
                my $parents = $ref->isa('Route::Node') ? $l : join(',', $ref->parents);
-               push @out, $self->msg('route', $l, $parents,  join(',', map {$_->call} Route::findroutes($l)));
+               my @n = map { $_->[1]->call . '(' .  (100 - $_->[0]) . ')' } Route::findroutes($l);
+               @n = @n[0,1,2,3],'...' if @n > 4;
+               push @out, $self->msg('route', $l, $parents,  join(',', @n));
        } else {
                push @out, $self->msg('e7', $l);
        }
index f637539c0c41c11f5ffa531b485789430a2fc4da..3c1c453e523a2a4088423576441b5730c771dade 100644 (file)
@@ -297,7 +297,7 @@ sub findroutes
        my $dxchan = DXChannel::get($call);
        if ($dxchan) {
                dbg("ROUTE: findroutes $call -> directly connected") if isdbg('findroutes');
-               return $dxchan;
+               return [99, $dxchan];
        }
 
        my $nref = Route::get($call);
@@ -311,7 +311,7 @@ sub findroutes
                $dxchan = DXChannel::get($p);
                if ($dxchan) {
                        dbg("ROUTE: findroutes $call -> connected direct via parent $p") if isdbg('findroutes');
-                       return $dxchan;
+                       return [99, $dxchan];
                }
 
                my $r = Route::Node::get($p);
@@ -331,10 +331,10 @@ sub findroutes
        }
 
        # get a sorted list of dxchannels with the highest hop count first
-       my @nout = map {$_->[1]} sort {$b->[0] <=> $a->[0]} @out;
+       my @nout = sort {$b->[0] <=> $a->[0]} @out;
        if (isdbg('findroutes')) {
-               if (@out) {
-                       foreach (sort {$b->[0] <=> $a->[0]} @out) {
+               if (@nout) {
+                       for (@nout) {
                                dbg("ROUTE: findroutes $call -> $_->[0] " . $_->[1]->call);
                        }
                }
@@ -348,7 +348,7 @@ sub alldxchan
 {
        my $self = shift;
        my @dxchan = findroutes($self->{call});
-       return @dxchan;
+       return map {$_->[1]} @dxchan;
 }
 
 sub dxchan
index afd61429e23cb3fc5ea928de13a4763287fd7583..1f410d4b137c995f9caa518cc7733d8f30df9b64 100644 (file)
@@ -11,6 +11,6 @@ use vars qw($version $subversion $build);
 
 $version = '1.55';
 $subversion = '0';
-$build = '16';
+$build = '17';
 
 1;