+sub cluster
+{
+ my $nodes = Route::Node::count();
+ my $tot = Route::User::count();
+ my $users = scalar DXCommandmode::get_all();
+ my $maxusers = Route::User::max();
+ my $uptime = main::uptime();
+
+ return " $nodes nodes, $users local / $tot total users Max users $maxusers Uptime $uptime";
+}
+
+#
+# routing things
+#
+
+sub get
+{
+ my $call = shift;
+ return Route::Node::get($call) || Route::User::get($call);
+}
+
+# find all the possible dxchannels which this object might be on
+sub alldxchan
+{
+ my $self = shift;
+
+ my $dxchan = DXChannel->get($self->{call});
+ if ($dxchan) {
+ return (grep $dxchan == $_, @_) ? () : ($dxchan);
+ }
+
+ # it isn't, build up a list of dxchannels and possible ping times
+ # for all the candidates.
+ my @dxchan = @_;
+ foreach my $p (@{$self->{parent}}) {
+ my $ref = $self->get($p);
+ push @dxchan, $ref->alldxchan(@dxchan) if $ref;
+ }
+ return @dxchan;
+}
+
+sub dxchan
+{
+ my $self = shift;
+ my $dxchan;
+ my @dxchan = $self->alldxchan;
+ return undef unless @dxchan;
+
+ # determine the minimum ping channel
+ my $minping = 99999999;
+ foreach my $dxc (@dxchan) {
+ my $p = $dxc->pingave;
+ if (defined $p && $p < $minping) {
+ $minping = $p;
+ $dxchan = $dxc;
+ }
+ }
+ $dxchan = shift @dxchan unless $dxchan;
+ return $dxchan;
+}
+