1. Reindented various things
authordjk <djk>
Wed, 23 Dec 1998 18:33:20 +0000 (18:33 +0000)
committerdjk <djk>
Wed, 23 Dec 1998 18:33:20 +0000 (18:33 +0000)
2. Added missing $main::mycall on the end of outgoing PC11s (!)
3. Check that PC16/17 node calls really are nodes (AFAIAC).

Changes
cmd/show/bands.pl
html/client.html
html/index.html
perl/DXCluster.pm
perl/DXProt.pm

diff --git a/Changes b/Changes
index 8d46b7aba643b99b69b193437140fcf748cf6bfe..a985aed84fbbe581767d72e128f77e3bbbae9870 100644 (file)
--- 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
index 5e71ec0f999b345371ad717940f2c68cf07e452b..d2b818aa0ce9ba5f433db5c090a25d1bc04cd719 100644 (file)
@@ -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);
index b63ec801eef7c80768e2c44767300fbddcbd94f9..d2962d29b17d56a8295979dd2286f1fdf141dee4 100644 (file)
@@ -2,7 +2,6 @@
 <html>
   <head>
     <title>The Standard Client</title>
-    <title>Connecting to other Clusters</title>
        <meta name="Keywords" content="DX Cluster, DXSpider, Spider, Packet Cluster, DXCluster, Pavillion Software, AK1A, AX25, AX.25, WWV, Packet Radio, Amateur Radio, Propagation, DX, DXing, G1TLH, GB7TLH, Dirk Koopman, Mailing list, Linux, RedHat, PERL">
        <meta name="Description" content="Software and systems for realtime digital communications between amateur radio stations for the provision of information on propagation conditions and stations operating">
        <meta name="Author" content="Dirk Koopman G1TLH">
@@ -20,7 +19,7 @@
        <p>
          <!-- Created: Sun Dec 13 20:25:14 GMT 1998 -->
          <!-- hhmts start -->
-Last modified: Mon Dec 21 12:26:18 GMT 1998
+Last modified: Wed Dec 23 16:08:12 GMT 1998
 <!-- hhmts end -->
 
        <h4>Introduction</h4>
@@ -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.
 
+       <p>Having said all of that the client <em>appears</em> to use the following files and
+         sends them to the user if they are present:-
+       <ul>
+         <li><b>/spider/data/motd</b> which is sent to the user on normal user startup.
+         <li><b>/spider/data/logout</b> which is sent to user on disconnection.
+         <li><b>/spider/data/offline</b> which is sent to the user if the cluster daemon 
+               isn't running.
+       </ul>
 
 <!-- Standard Footer!! -->
        <p>&nbsp;</p>
index f10c02656b249d10a8fc8d3a10282f908614933b..22cad7e41974b8dcec8ee9cbb2659e46f3af5a2a 100644 (file)
        <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>
 
index 8bd2c36ffb772eb5a24edab6b35d996dfc1c36f1..91c43a7880a8944d7fdbb0754bc7d8c1e58d0b35 100644 (file)
@@ -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
index c1fad11126edbc072d6681e71a70834ef5856f8e..27416fab8e36952cd442263605024c3dd4dde1fb 100644 (file)
@@ -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?)