+
+#
+# Generate a configuration for onward broadcast
+#
+# Basically, this creates a thingy with list of nodes and users that
+# are on this node. This the normal method of spreading this
+# info whenever a node connects and also periodically.
+#
+
+sub new_cf
+{
+ my $pkg = shift;
+ my $thing = $pkg->SUPER::new(@_);
+
+ $thing->{'s'} = 'cf';
+
+ my @anodes;
+ my @pnodes;
+ my @users;
+
+ foreach my $dxchan (DXChannel::get_all()) {
+ next if $dxchan == $main::me;
+ if ($dxchan->is_node) {
+ my $ref = Route::Node::get($dxchan->{call});
+ push @pnodes, $ref if $ref;
+ } elsif ($dxchan->is_aranea) {
+ my $ref = Route::Node::get($dxchan->{call});
+ push @anodes, $ref if $ref;
+ } else {
+ my $ref = Route::User::get($dxchan->{call});
+ push @users, $ref if $ref;
+ }
+ }
+ $thing->{anodes} = \@anodes if @anodes;
+ $thing->{pnodes} = \@pnodes if @pnodes;
+ $thing->{ausers} = \@users if @users;
+ return $thing;
+}
+
+#
+# copy out the PC16 data for a node into the
+# pc16n and u slots if there are any users
+#
+sub copy_pc16_data
+{
+ my $thing = shift;
+ my $uref = shift;
+
+ $thing->{'s'} = 'cf';
+
+ my @u = $uref->users;
+ if (@u) {
+ $thing->{ausers} = [map {Route::User::get($_)} @u];
+ return scalar @u;
+ }
+ return undef;
+}
+
+
+