<p>
<!-- Created: Wed Dec 2 18:22:33 GMT 1998 -->
<!-- hhmts start -->
-Last modified: Mon Dec 21 11:58:48 GMT 1998
+Last modified: Wed Dec 23 16:59:32 GMT 1998
<!-- hhmts end -->
- <p>The DXSpider dx cluster system is written in perl5 as an exercise in self-training
- for both protocol research and teaching myself perl.
- <p>This document will contain all the instructions for its installation and use -
- eventually
- <h3>Contents</h3>
+
+ <h4>Introduction</h4>
+
+ The DXSpider DX cluster system is written in <a
+ href="http://www.perl.com">perl 5.004</a> running under <a
+ href="http://www.linuxhq.com">Linux</a> as an exercise in
+ self-training for both protocol research and teaching myself <a
+ href="http://www.perl.com">perl</a>.
+
+ <h4>What is a DX Cluster?</h4>
+
+ A DX Cluster is a means for Amateur (Ham) Radio operators to tell each
+ other, in realtime, about DX stations (other interesting or rare
+ Amateur Radio stations all over the world).
+
+ <p>To quote what is probably the most comprenhsive source of DX Cluster related
+ information, the <a href="http://www.cestro.com/pcluster/">DX PacketCluster WebNet</a>,
+ a Cluster is:-
+
+ <p><em>One station is set up with PacketCluster and is linked to one or
+ more other stations who have installed the software. These nodes
+ when connected are called a cluster. Clusters are connected to
+ clusters, expanding the network. Individual users connect to the
+ nodes on a frequency different from what the node stations are
+ linked on. Users are capable of announcing DX spots and related
+ announcements, send personal talk messages, send and receive
+ mail messages, search and retrive archived data, and access data
+ from information databases among its many features.</em>
+
+ <p>It's a rather specialised (and not as robust) form of IRC really.
+
+ <p>The original package runs under DOS and was created by Dick Newell AK1A
+ but is no longer under active development. Most replacements also run under
+ DOS and/or are closed source. I wanted something in open source (so I don't
+ have to do <em>all</em> the work) and for Linux.
+
+ <p>This document will contain all the instructions for its
+ installation and use - eventually...
+
+ <h4>Contents</h4>
<ol>
<li> <a href="install.html">Installation</a> of the main cluster software.
<li> Installing the lastest version of <a href="cpan.html">CPAN</a>.
<li> Explaining the <a href="client.html">client.pl</a> program.
<li> <a href="connect.html">Connecting</a> to other clusters.
<li> <a href="hops.html">Hop</a> control, network <a href="hops.html#isolate">isolation</a> etc.
+ <li> <a href="program.html">Programming</a> new commands or altering existing ones.
<li> <a href="../download/">Download</a> the software and any patches.
</ol>
use strict;
use vars qw(%cluster %valid);
-%cluster = (); # this is where we store the dxcluster database
+%cluster = (); # this is where we store the dxcluster database
%valid = (
- mynode => '0,Parent Node,showcall',
- call => '0,Callsign',
- confmode => '0,Conference Mode,yesno',
- here => '0,Here?,yesno',
- dxchan => '5,Channel ref',
- pcversion => '5,Node Version',
- list => '5,User List,dolist',
- users => '0,No of Users',
-);
+ mynode => '0,Parent Node,showcall',
+ call => '0,Callsign',
+ confmode => '0,Conference Mode,yesno',
+ here => '0,Here?,yesno',
+ dxchan => '5,Channel ref',
+ pcversion => '5,Node Version',
+ list => '5,User List,dolist',
+ users => '0,No of Users',
+ );
sub alloc
{
- my ($pkg, $dxchan, $call, $confmode, $here) = @_;
- die "$call is already alloced" if $cluster{$call};
- my $self = {};
- $self->{call} = $call;
- $self->{confmode} = $confmode;
- $self->{here} = $here;
- $self->{dxchan} = $dxchan;
-
- $cluster{$call} = bless $self, $pkg;
- return $self;
+ my ($pkg, $dxchan, $call, $confmode, $here) = @_;
+ die "$call is already alloced" if $cluster{$call};
+ my $self = {};
+ $self->{call} = $call;
+ $self->{confmode} = $confmode;
+ $self->{here} = $here;
+ $self->{dxchan} = $dxchan;
+
+ $cluster{$call} = bless $self, $pkg;
+ return $self;
}
# get an entry exactly as it is
sub get_exact
{
- my ($pkg, $call) = @_;
+ my ($pkg, $call) = @_;
- # belt and braces
- $call = uc $call;
+ # belt and braces
+ $call = uc $call;
- # search for 'as is' only
- return $cluster{$call};
+ # search for 'as is' only
+ return $cluster{$call};
}
#
#
sub get
{
- my ($pkg, $call) = @_;
+ my ($pkg, $call) = @_;
- # belt and braces
- $call = uc $call;
+ # belt and braces
+ $call = uc $call;
- # search for 'as is'
- my $ref = $cluster{$call};
- return $ref if $ref;
-
- # search for the unSSIDed one
- $call =~ s/-\d+$//o;
- $ref = $cluster{$call};
- return $ref if $ref;
+ # search for 'as is'
+ my $ref = $cluster{$call};
+ return $ref if $ref;
+
+ # search for the unSSIDed one
+ $call =~ s/-\d+$//o;
+ $ref = $cluster{$call};
+ return $ref if $ref;
- # search for the SSIDed one
- my $i;
- for ($i = 1; $i < 17; $i++) {
- $ref = $cluster{"$call-$i"};
- return $ref if $ref;
- }
- return undef;
+ # search for the SSIDed one
+ my $i;
+ for ($i = 1; $i < 17; $i++) {
+ $ref = $cluster{"$call-$i"};
+ return $ref if $ref;
+ }
+ return undef;
}
# get all
sub get_all
{
- return values(%cluster);
+ return values(%cluster);
}
# return a prompt for a field
sub field_prompt
{
- my ($self, $ele) = @_;
- return $valid{$ele};
+ my ($self, $ele) = @_;
+ return $valid{$ele};
}
# this expects a reference to a list in a node NOT a ref to a node
sub dolist
{
- my $self = shift;
- my $out;
- my $ref;
+ my $self = shift;
+ my $out;
+ my $ref;
- foreach $ref (@{$self}) {
- my $s = $ref->{call};
- $s = "($s)" if !$ref->{here};
- $out .= "$s ";
- }
- chop $out;
- return $out;
+ foreach $ref (@{$self}) {
+ my $s = $ref->{call};
+ $s = "($s)" if !$ref->{here};
+ $out .= "$s ";
+ }
+ chop $out;
+ return $out;
}
# this expects a reference to a node
sub showcall
{
- my $self = shift;
- return $self->{call};
+ my $self = shift;
+ return $self->{call};
}
# the answer required by show/cluster
sub DESTROY
{
- my $self = shift;
- dbg('cluster', "destroying $self->{call}\n");
+ my $self = shift;
+ dbg('cluster', "destroying $self->{call}\n");
}
no strict;
sub AUTOLOAD
{
- my $self = shift;
- my $name = $AUTOLOAD;
+ my $self = shift;
+ my $name = $AUTOLOAD;
- return if $name =~ /::DESTROY$/;
- $name =~ s/.*:://o;
+ return if $name =~ /::DESTROY$/;
+ $name =~ s/.*:://o;
- confess "Non-existant field '$AUTOLOAD'" if !$valid{$name};
- @_ ? $self->{$name} = shift : $self->{$name} ;
+ confess "Non-existant field '$AUTOLOAD'" if !$valid{$name};
+ @_ ? $self->{$name} = shift : $self->{$name} ;
}
#
sub new
{
- my ($pkg, $dxchan, $node, $call, $confmode, $here) = @_;
+ my ($pkg, $dxchan, $node, $call, $confmode, $here) = @_;
- die "tried to add $call when it already exists" if DXCluster->get_exact($call);
+ die "tried to add $call when it already exists" if DXCluster->get_exact($call);
- my $self = $pkg->alloc($dxchan, $call, $confmode, $here);
- $self->{mynode} = $node;
- $node->{list}->{$call} = $self; # add this user to the list on this node
- dbg('cluster', "allocating user $call to $node->{call} in cluster\n");
- $node->update_users;
- return $self;
+ my $self = $pkg->alloc($dxchan, $call, $confmode, $here);
+ $self->{mynode} = $node;
+ $node->{list}->{$call} = $self; # add this user to the list on this node
+ dbg('cluster', "allocating user $call to $node->{call} in cluster\n");
+ $node->update_users();
+ return $self;
}
sub del
{
- my $self = shift;
- my $call = $self->{call};
- my $node = $self->{mynode};
-
- delete $node->{list}->{$call};
- delete $DXCluster::cluster{$call}; # remove me from the cluster table
- dbg('cluster', "deleting user $call from $node->{call} in cluster\n");
- $node->update_users;
+ my $self = shift;
+ my $call = $self->{call};
+ my $node = $self->{mynode};
+
+ delete $node->{list}->{$call};
+ delete $DXCluster::cluster{$call}; # remove me from the cluster table
+ dbg('cluster', "deleting user $call from $node->{call} in cluster\n");
+ $node->update_users();
}
sub count
{
- return $DXNode::users; # + 1 for ME (naf eh!)
+ return $DXNode::users; # + 1 for ME (naf eh!)
}
no strict;
sub new
{
- my ($pkg, $dxchan, $call, $confmode, $here, $pcversion) = @_;
- my $self = $pkg->alloc($dxchan, $call, $confmode, $here);
- $self->{pcversion} = $pcversion;
- $self->{list} = { } ;
- $self->{mynode} = $self; # for sh/station
- $self->{users} = 0;
- $nodes++;
- dbg('cluster', "allocating node $call to cluster\n");
- return $self;
+ my ($pkg, $dxchan, $call, $confmode, $here, $pcversion) = @_;
+ my $self = $pkg->alloc($dxchan, $call, $confmode, $here);
+ $self->{pcversion} = $pcversion;
+ $self->{list} = { } ;
+ $self->{mynode} = $self; # for sh/station
+ $self->{users} = 0;
+ $nodes++;
+ dbg('cluster', "allocating node $call to cluster\n");
+ return $self;
}
# get all the nodes
sub get_all
{
- my $list;
- my @out;
- foreach $list (values(%DXCluster::cluster)) {
- push @out, $list if $list->{pcversion};
- }
- return @out;
+ my $list;
+ my @out;
+ foreach $list (values(%DXCluster::cluster)) {
+ push @out, $list if $list->{pcversion};
+ }
+ return @out;
}
sub del
{
- my $self = shift;
- my $call = $self->{call};
- my $ref;
-
- # delete all the listed calls
- foreach $ref (values %{$self->{list}}) {
- $ref->del(); # this also takes them out of this list
- }
- delete $DXCluster::cluster{$call}; # remove me from the cluster table
- dbg('cluster', "deleting node $call from cluster\n");
- $nodes-- if $nodes > 0;
+ my $self = shift;
+ my $call = $self->{call};
+ my $ref;
+
+ # delete all the listed calls
+ foreach $ref (values %{$self->{list}}) {
+ $ref->del(); # this also takes them out of this list
+ }
+ delete $DXCluster::cluster{$call}; # remove me from the cluster table
+ dbg('cluster', "deleting node $call from cluster\n");
+ $nodes-- if $nodes > 0;
}
sub update_users
{
- my $self = shift;
- my $count = shift;
- $count = 0 unless $count;
+ my $self = shift;
+ my $count = shift;
+ $count = 0 unless $count;
- $users -= $self->{users} if $self->{users};
- if ((keys %{$self->{list}})) {
- $self->{users} = (keys %{$self->{list}});
- } else {
- $self->{users} = $count;
- }
- $users += $self->{users} if $self->{users};
- $maxusers = $users+$nodes if $users+$nodes > $maxusers;
+ $users -= $self->{users} if $self->{users};
+ if ((keys %{$self->{list}})) {
+ $self->{users} = (keys %{$self->{list}});
+ } else {
+ $self->{users} = $count;
+ }
+ $users += $self->{users} if $self->{users};
+ $maxusers = $users+$nodes if $users+$nodes > $maxusers;
}
sub count
{
- return $nodes; # + 1 for ME!
+ return $nodes; # + 1 for ME!
}
sub dolist