+ }
+ # del users here
+ foreach my $r (@$dnodes) {
+ push @rdel,_del_thingy($parent, [$r, 1], $self);
+ }
+ foreach my $r (@$dusers) {
+ push @rdel,_del_thingy($parent, [$r, 0], $self);
+ }
+
+ # remember this last PC92C for rebroadcast on demand
+ $parent->last_PC92C($line);
+ } else {
+ dbg("PCPROT: unknown action '$sort', ignored") if isdbg('chanerr');
+ return;
+ }
+
+ foreach my $r (@rdel) {
+ next unless $r;
+
+ $self->route_pc21($pcall, undef, $r) if $r->isa('Route::Node');
+ $self->route_pc17($pcall, undef, $parent, $r) if $r->isa('Route::User');
+ }
+ my @pc19 = grep { $_ && $_->isa('Route::Node') } @radd;
+ my @pc16 = grep { $_ && $_->isa('Route::User') } @radd;
+ unshift @pc19, $parent if $self->{state} eq 'init92' && $oparent == $parent;
+ $self->route_pc19($pcall, undef, @pc19) if @pc19;
+ $self->route_pc16($pcall, undef, $parent, @pc16) if @pc16;
+ }
+
+ # broadcast it if we get here
+ $self->broadcast_route_pc9x($pcall, undef, $line, 0);
+}
+
+# get all the routes for a thing, bearing in mind that the thing (e.g. a user)
+# might be on two or more nodes at the same time or that there may be more than
+# one equal distance neighbour to a node.
+#
+# What this means that if sh/route g1tlh shows that he is on (say) two nodes, then
+# a Route::findroutes is done on each of those two nodes, the best route(s) taken from
+# each and then combined to give a set of dxchans to send the PC9x record down
+#
+sub find_pc9x_routes
+{
+ my $to = shift;
+ my $ref = Route::get($to);
+ my @parent;
+ my %cand;
+
+ if ($ref->isa('Route::User')) {
+ my $dxchan = DXChannel::get($to);
+ push @parent, $to if $dxchan;
+ push @parent, $ref->parents;
+ } else {
+ @parent = $to;
+ }
+ foreach my $p (@parent) {
+ my $lasthops;
+ my @routes = Route::findroutes($p);
+ foreach my $r (@routes) {
+ $lasthops = $r->[0] unless defined $lasthops;
+ if ($r->[0] == $lasthops) {
+ $cand{$r->[1]->call} = $r->[1];