From 1994ae9ca216a19bf373948c5e8d79a9d58369d6 Mon Sep 17 00:00:00 2001 From: djk Date: Wed, 23 Dec 1998 18:33:20 +0000 Subject: [PATCH] 1. Reindented various things 2. Added missing $main::mycall on the end of outgoing PC11s (!) 3. Check that PC16/17 node calls really are nodes (AFAIAC). --- Changes | 4 + cmd/show/bands.pl | 44 +++++---- html/client.html | 11 ++- html/index.html | 48 +++++++-- perl/DXCluster.pm | 242 +++++++++++++++++++++++----------------------- perl/DXProt.pm | 5 +- 6 files changed, 203 insertions(+), 151 deletions(-) diff --git a/Changes b/Changes index 8d46b7ab..a985aed8 100644 --- a/Changes +++ b/Changes @@ -1,3 +1,7 @@ +23Dec98======================================================================== +1. Reindented various things +2. Added missing $main::mycall on the end of outgoing PC11s (!) +3. Check that PC16/17 node calls really are nodes (AFAIAC). 22Dec98======================================================================== 1. Added brackets round callsign if not here for prompt 2. Added Iain's set/password routine diff --git a/cmd/show/bands.pl b/cmd/show/bands.pl index 5e71ec0f..d2b818aa 100644 --- a/cmd/show/bands.pl +++ b/cmd/show/bands.pl @@ -1,6 +1,10 @@ # # display the band data # +# Copyright (c) 1998 - Dirk Koopman G1TLH +# +# $Id$ +# #$DB::single = 1; @@ -12,26 +16,26 @@ my @out; my $i; if (!$line) { - @bands = sort { Bands::get($a)->band->[0] <=> Bands::get($b)->band->[0] } Bands::get_keys(); - push @out, "Bands Available:-"; - foreach $band (@bands) { - my $ref = Bands::get($band)->band; - my $s = sprintf "%10s: ", $band; - for ($i = 0; $i < $#{$ref}; $i += 2) { - my $from = $ref->[$i]; - my $to = $ref->[$i+1]; - $s .= ", " if $i; - $s .= "$from -> $to"; - } - push @out, $s; - } - push @out, "Regions Available:-"; - @bands = Bands::get_region_keys(); - foreach $band (@bands) { - my $ref = Bands::get_region($band); - my $s = sprintf("%10s: ", $band ) . join(' ', @{$ref}); - push @out, $s; - } + @bands = sort { Bands::get($a)->band->[0] <=> Bands::get($b)->band->[0] } Bands::get_keys(); + push @out, "Bands Available:-"; + foreach $band (@bands) { + my $ref = Bands::get($band)->band; + my $s = sprintf "%10s: ", $band; + for ($i = 0; $i < $#{$ref}; $i += 2) { + my $from = $ref->[$i]; + my $to = $ref->[$i+1]; + $s .= ", " if $i; + $s .= "$from -> $to"; + } + push @out, $s; + } + push @out, "Regions Available:-"; + @bands = Bands::get_region_keys(); + foreach $band (@bands) { + my $ref = Bands::get_region($band); + my $s = sprintf("%10s: ", $band ) . join(' ', @{$ref}); + push @out, $s; + } } return (1, @out); diff --git a/html/client.html b/html/client.html index b63ec801..d2962d29 100644 --- a/html/client.html +++ b/html/client.html @@ -2,7 +2,6 @@ The Standard Client - Connecting to other Clusters @@ -20,7 +19,7 @@

-Last modified: Mon Dec 21 12:26:18 GMT 1998 +Last modified: Wed Dec 23 16:08:12 GMT 1998

Introduction

@@ -106,6 +105,14 @@ Last modified: Mon Dec 21 12:26:18 GMT 1998 and password is entered it uses the standard cluster user file to check them. +

Having said all of that the client appears to use the following files and + sends them to the user if they are present:- +

 

diff --git a/html/index.html b/html/index.html index f10c0265..22cad7e4 100644 --- a/html/index.html +++ b/html/index.html @@ -18,19 +18,55 @@

-Last modified: Mon Dec 21 11:58:48 GMT 1998 +Last modified: Wed Dec 23 16:59:32 GMT 1998 -

The DXSpider dx cluster system is written in perl5 as an exercise in self-training - for both protocol research and teaching myself perl. -

This document will contain all the instructions for its installation and use - - eventually -

Contents

+ +

Introduction

+ + The DXSpider DX cluster system is written in perl 5.004 running under Linux as an exercise in + self-training for both protocol research and teaching myself perl. + +

What is a DX Cluster?

+ + 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). + +

To quote what is probably the most comprenhsive source of DX Cluster related + information, the DX PacketCluster WebNet, + a Cluster is:- + +

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. + +

It's a rather specialised (and not as robust) form of IRC really. + +

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 all the work) and for Linux. + +

This document will contain all the instructions for its + installation and use - eventually... + +

Contents

  1. Installation of the main cluster software.
  2. Installing the lastest version of CPAN.
  3. Explaining the client.pl program.
  4. Connecting to other clusters.
  5. Hop control, network isolation etc. +
  6. Programming new commands or altering existing ones.
  7. Download the software and any patches.
diff --git a/perl/DXCluster.pm b/perl/DXCluster.pm index 8bd2c36f..91c43a78 100644 --- a/perl/DXCluster.pm +++ b/perl/DXCluster.pm @@ -22,43 +22,43 @@ use Carp; 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}; } # @@ -67,63 +67,63 @@ sub get_exact # 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 @@ -138,21 +138,21 @@ sub 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} ; } # @@ -169,33 +169,33 @@ use strict; 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; @@ -220,62 +220,62 @@ $maxusers = 0; 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 diff --git a/perl/DXProt.pm b/perl/DXProt.pm index c1fad111..27416fab 100644 --- a/perl/DXProt.pm +++ b/perl/DXProt.pm @@ -244,12 +244,13 @@ sub normal if ($pcno == 16) { # add a user my $node = DXCluster->get_exact($field[1]); last SWITCH if !$node; # ignore if havn't seen a PC19 for this one yet + last SWITCH unless $node->isa('DXNode'); my $i; for ($i = 2; $i < $#field; $i++) { - my ($call, $confmode, $here) = $field[$i] =~ /^(\S+) (-) (\d)/o; - next if length $call < 3; + my ($call, $confmode, $here) = $field[$i] =~ /^(\S+) (\S) (\d)/o; + next if length $call < 3 || length $call > 8; next if !$confmode; $call = uc $call; next if DXCluster->get_exact($call); # we already have this (loop?) -- 2.43.0