added ssid handling
authordjk <djk>
Wed, 24 Nov 1999 21:31:43 +0000 (21:31 +0000)
committerdjk <djk>
Wed, 24 Nov 1999 21:31:43 +0000 (21:31 +0000)
added sh/time
added help for sh/time, sh/sun, sh/moon

Changes
cmd/Commands_en.hlp
cmd/show/time.pl [new file with mode: 0644]
perl/DXUtil.pm
perl/Messages
perl/client.pl
perl/cluster.pl
perl/console.pl

diff --git a/Changes b/Changes
index acbf476b1aa614bd6f612e2d45d68044c8f0c600..8f2619c4f68c3bc89548a81ce95a7407a95cb344 100644 (file)
--- a/Changes
+++ b/Changes
@@ -9,11 +9,17 @@ unread private mail does.
 SSIDs to -8 as different entities from each other. SSIDs > 8 are subtracted 
 from 15 and are assumed to be coming in via netrom diddled connections. This
 affects lots of the commands as well. I may not have got them all.
+5. Hangup clients on HUP signals. I originally ignored them, for reasons that
+are now lost in the mists of time. HUP signals now cause clients to die 
+(cleanly) and disconnect everything correctly.
 21Nov99=======================================================================
 1. lose extraneous rubbish after the callsign as sent by BBSes.
 2. Change end label on sh/moon to RGain dB rather than Loss dB.
 3. Remove spurious call to DXCluster->get_exact in pc50.
-4. Allow rcmd to locally connected nodes that are not in the nodes table.
+4. Allow rcmd to locally connected nodes that are not (for some reason) in the
+nodes table.
+5. Try and send a PC39 in more cases to a cluster that I want to disconnect
+from in the hope that it notices and disconnects its end.
 20Nov99=======================================================================
 1. Added set/unset logininfo which will tell anybody that has this set when
 someone has either logged in or out of this node.
index 6c2db106801699e0963da02e77372933fc034c64..97f4771e3c30a149b060bad63da73724ec929f80 100644 (file)
@@ -452,13 +452,42 @@ Tell the system what your name is eg:-
 Tell the system that the call(s) are to be treated as AK1A cluster and
 fed PC Protocol rather normal user commands.
 
+=== 9^SET/OBSCOUNT <count> <nodecall>^Set the 'pump-up' obscelence counter 
+From 1.35 onwards neighbouring nodes are pinged at regular intervals (see
+SET/PINGINTERVAL), usually 300 seconds or 5 minutes. There is a 'pump-up'
+counter which is decremented on every outgoing ping and then reset to
+the 'obscount' value on every incoming ping. The default value of this
+parameter is 2. 
+
+What this means is that a neighbouring node will be pinged twice at 
+(default) 300 second intervals and if no reply has been heard just before
+what would be the third attempt, that node is disconnected.
+
+If a ping is heard then the obscount is reset to the full value. Using
+default values, if a node has not responded to a ping within 15 minutes,
+it is disconnected.
+
 === 0^SET/PAGE <lines per page>^Set the lines per page
 Tell the system how many lines you wish on a page when the number of line
 of output from a command is more than this. The default is 20. Setting it
 explicitly to 0 will disable paging. 
   SET/PAGE 30
   SET/PAGE 0
+
+=== 9^SET/PINGINTERVAL <time> <nodecall>^Set ping time to neighbouring nodes 
+As from release 1.35 all neighbouring nodes are pinged at regular intervals
+in order to determine the rolling quality of the link and, in future, to
+affect routing decisions. The default interval is 300 secs or 5 minutes.
+
+You can use this command to set a different interval. Please don't. 
+
+But if you do the value you enter is treated as minutes up 60 and seconds
+for numbers greater than that.
+
+This is used also to help determine when a link is down at the far end
+(as certain cluster software doesn't always notice), see SET/OBSCOUNT
+for more information.
+
 === 9^SET/PRIVILEGE <n> <call> [<call..]^Set privilege level on a call
 Set the privilege level on a callsign. The privilege levels that pertain
 to commands are as default:-
@@ -477,7 +506,11 @@ The password for a user can only be set by a full sysop. The string
 can contain any characters but any spaces are removed (you can type in
 spaces - but they won't appear in the password). You can see the
 result with STAT/USER.
+
+=== 9^SET/SPIDER <call> [<call>..]^Make the callsign an DXSpider node
+Tell the system that the call(s) are to be treated as DXSpider node and
+fed new style DX Protocol rather normal user commands.
+
 === 9^SET/SYS_QRA <locator>^Set your cluster QRA locator
 === 0^SET/QRA <locator>^Set your QRA locator
 Tell the system what your QRA (or Maidenhead) locator is. If you have not
@@ -569,6 +602,26 @@ string to see a selection of files in a filearea eg:-
 
 See also TYPE - to see the contents of a file.
 
+=== 0^SHOW/MOON [<prefix>|<callsign>]^Show Moon rise and set times
+Show the Moon rise and set times for a (list of) prefixes or callsigns, 
+together with the azimuth and elevation of the sun currently at those
+locations.
+
+If you don't specify any prefixes or callsigns, it will show the times for
+your QTH (assuming you have set it with either SET/LOCATION or SET/QRA),
+together with the current azimuth and elevation.
+
+In addition, it will show the gain or loss dB relative to the nominal 
+distance of 385,000Km due to the ellipsoidal nature of the orbit.
+
+If all else fails it will show the Moonrise and set times for the node
+that you are connected to. 
+
+For example:-
+
+  SH/MOON
+  SH/MOON G1TLH W5UN
+
 === 0^SHOW/MUF <prefix> [<hours>][long]^Show the likely propagation to a prefix
 This command allow you to estimate the likelihood of you contacting
 a station with the prefix you have specified. The output assumes a modest
@@ -643,21 +696,33 @@ together with the internal country no, the CQ and ITU regions.
 
 See also SHOW/DXCC
 
-=== 0^SHOW/SUN [<callsign>|<prefix>]^Display sunrise and sunset times
-Show the sunrise and sunset times for a callsign (if it is known to the
-cluster), a prefix or, if nothing is specified, at your QTH (if you have
-remembered to set your location using SET/LOCATION or SET/QRA). If all else
-fails it will show the sunrise and set times for the node that you are 
-connected to.
-
-You can enter more than one prefix or callsign:-
-
-  SH/SUN G1TLH G8TIC W9
-
 === 5^SHOW/PROGRAM^Show the locations of all the included program modules
 Show the name and location where every program module was load from. This
 is useful for checking where you think you have loaded a .pm file from. 
 
+=== 0^SHOW/SUN [<prefix>|<callsign>]^Show sun rise and set times
+Show the sun rise and set times for a (list of) prefixes or callsigns, 
+together with the azimuth and elevation of the sun currently at those
+locations.
+
+If you don't specify any prefixes or callsigns, it will show the times for
+your QTH (assuming you have set it with either SET/LOCATION or SET/QRA),
+together with the current azimuth and elevation.
+
+If all else fails it will show the sunrise and set times for the node
+that you are connected to. 
+
+For example:-
+
+  SH/SUN
+  SH/SUN G1TLH K9CW ZS
+
+=== 0^SHOW/TIME [<prefix>|<callsign>]^Show the local time 
+If no prefixes or callsigns are given then this command returns the local
+time and UTC as the computer has it right now. If you give some prefixes
+then it will show UTC and UTC + the local offset (not including DST) at
+the prefixes or callsigns that you specify.
+
 === 0^SHOW/WWV^Show last 10 WWV broadcasts
 === 0^SHOW/WWV <n>^Show last <n> WWV broadcasts
 Display the most recent WWV information that has been received by the system
diff --git a/cmd/show/time.pl b/cmd/show/time.pl
new file mode 100644 (file)
index 0000000..2054754
--- /dev/null
@@ -0,0 +1,41 @@
+#!/usr/bin/perl
+#
+# show local times for each callsign or prefix entered
+#
+# Copyright (c) 1999 Dirk Koopman G1TLH
+#
+# $Id$
+#
+
+my ($self, $line) = @_;
+my @list = split /\s+/, $line;
+
+my $l;
+my @out;
+my $t = $main::systime;
+
+push @out, $self->msg("time1", cldate($t, 1), ztime($t, 1), ztime($t));
+
+if (@list) {
+       foreach $l (@list) {
+               # prefixes --->
+               my @ans = Prefix::extract($l);
+               next if !@ans;
+               my $pre = shift @ans;
+               my $a;
+               foreach $a (@ans) {
+                       my $s = sprintf "%-9s %-20s", $pre, $a->name();
+
+                       # UTC offset is in hours.minutes (too late to change it now) AND
+            # the wrong way round!
+                       my $off = $a->utcoff();
+                       my $frac = $off - int $off;
+                       $off = (int $off) + (($frac*100)/60);
+                       my ($sec,$min,$hour) = gmtime($t - 3600*$off);
+                       my $buf = sprintf "%02d%02d", $hour, $min;
+                       push @out, $self->msg("time2", $s, $buf, sprintf("%+.1f", -$off));
+               }
+       }
+} 
+
+return (1, @out);
index caaa38008b18928ad4435612ed84357ce67b965b..de9ea018677765c837c56cf847d9ee7917ec90d0 100644 (file)
@@ -43,18 +43,20 @@ sub atime
 sub ztime
 {
        my $t = shift;
-       my ($sec,$min,$hour) = gmtime((defined $t) ? $t : time);
-       $year += 1900;
-       my $buf = sprintf "%02d%02dZ", $hour, $min;
+       $t = defined $t ? $t : time;
+       my $dst = shift;
+       my ($sec,$min,$hour) = $dst ? localtime($t): gmtime($t);
+       my $buf = sprintf "%02d%02d%s", $hour, $min, ($dst) ? '' : 'Z';
        return $buf;
-
 }
 
 # get a cluster format date (23-Jun-1998)
 sub cldate
 {
        my $t = shift;
-       my ($sec,$min,$hour,$mday,$mon,$year) = gmtime((defined $t) ? $t : time);
+       $t = defined $t ? $t : time;
+       my $dst = shift;
+       my ($sec,$min,$hour,$mday,$mon,$year) = $dst ? localtime($t) : gmtime($t);
        $year += 1900;
        my $buf = sprintf "%2d-%s-%04d", $mday, $month[$mon], $year;
        return $buf;
@@ -64,8 +66,9 @@ sub cldate
 sub cldatetime
 {
        my $t = shift;
-       my $date = cldate($t);
-       my $time = ztime($t);
+       my $dst = shift;
+       my $date = cldate($t, $dst);
+       my $time = ztime($t, $dst);
        return "$date $time";
 }
 
index 5f5e2ea83230c6a47b214a0a0ddfb83a56262aff..7fa5be92e4f7d116d4a3b8bb65ce05f4aaee17c3 100644 (file)
@@ -155,6 +155,8 @@ package DXM;
                                suser2 => 'User $_[0] not found',
                                suser3 => 'User field \'$_[0]\' was \'$_[1]\' now set to \'$_[2]\'',
                                suser4 => 'User field name \'$_[0]\' doesn\'t exist',
+                               time1 => 'Local Time: $_[0] $_[1], UTC $_[2]',
+                               time2 => '$_[0] Local (standard) time: $_[1] ($_[2] Hours)',
                                talks => 'Talk flag set on $_[0]',
                                talku => 'Talk flag unset on $_[0]',
                                usernf => '*** User record for $_[0] not found ***',
index 0199084fdabf101c62fe0f6585a2d663edab924b..642f80c6e0bf6b54604dbdf2758820bc035fde53 100755 (executable)
@@ -304,6 +304,14 @@ sub timeout
        cease(0);
 }
 
+# handle callsign and connection type firtling
+sub doclient
+{
+       my $line = shift;
+       my @f = split /\s+/, $line;
+       $call = uc $f[0] if $f[0];
+       $csort = $f[1] if $f[1];
+}
 
 #
 # initialisation
@@ -403,15 +411,6 @@ if ($loginreq) {
        alarm(0);
 }
 
-# handle callsign and connection type firtling
-sub doclient
-{
-       my $line = shift;
-       my @f = split /\s+/, $line;
-       $call = uc $f[0] if $f[0];
-       $csort = $f[1] if $f[1];
-}
-
 # is this an out going connection?
 if ($connsort eq "connect") {
        my $mcall = lc $call;
@@ -467,6 +466,20 @@ if ($connsort eq "connect") {
 $mode = ($connsort eq 'ax25') ? 1 : 2;
 setmode();
 
+# adjust the callsign if it has an SSID, SSID <= 8 are legal > 8 are netrom connections
+my ($scall, $ssid) = split /-/, $call;
+$ssid = undef unless $ssid && $ssid =~ /^\d+$/;  
+if ($ssid) {
+       $ssid = 15 if $ssid > 15;
+       if ($connsort eq 'ax25') {
+               if ($ssid > 8) {
+                       $ssid = 15 - $ssid;
+               }
+       }
+       $call = "$scall-$ssid";
+}
+
+
 $conn = Msg->connect("$clusteraddr", $clusterport, \&rec_socket);
 if (! $conn) {
        if (-r "$data/offline") {
index a46e3b2d58f692e9905666b4618484a47c8be18a..751a68a851f88f7a725306097c3e3c3fe6e4a81a 100755 (executable)
@@ -113,16 +113,6 @@ sub rec
        # set up the basic channel info - this needs a bit more thought - there is duplication here
        if (!defined $dxchan) {
                my ($sort, $call, $line) = $msg =~ /^(\w)(\S+)\|(.*)$/;
-               my ($scall, $ssid) = split /-/, $call;
-               
-               # adjust the callsign if it has an SSID, SSID <= 8 are legal > 8 are netrom connections
-        if ($ssid) {
-                       $ssid = 15 if $ssid > 15;
-                       if ($ssid > 8) {
-                               $ssid = 15 - $ssid;
-                               $call = "$scall-$ssid";
-                       }
-               }
  
                # is there one already connected to me - locally? 
                my $user = DXUser->get($call);
index bfd7700da0a011442e2822b97433533d27f45c0c..e6f96aad9c713c9577d53eb367b9e1eed3dab909 100755 (executable)
@@ -402,6 +402,12 @@ sub rec_stdin
 
 $call = uc shift @ARGV if @ARGV;
 $call = uc $myalias if !$call;
+my ($scall, $ssid) = split /-/, $call;
+$ssid = undef unless $ssid && $ssid =~ /^\d+$/;  
+if ($ssid) {
+       $ssid = 15 if $ssid > 15;
+       $call = "$scall-$ssid";
+}
 
 if ($call eq $mycall) {
        print "You cannot connect as your cluster callsign ($mycall)\n";