From 2343a398ca48f31195884e223839dfa0cb1d135f Mon Sep 17 00:00:00 2001 From: djk Date: Sun, 2 May 1999 14:49:10 +0000 Subject: [PATCH] added user filtering (or at leats the capability for it) fixed isolation problem --- Changes | 4 +++ cmd/dx.pl | 8 +++--- perl/DXProt.pm | 68 +++++++++++++++++++++++++++---------------------- perl/cluster.pl | 2 +- 4 files changed, 47 insertions(+), 35 deletions(-) diff --git a/Changes b/Changes index cbed3239..7d23e07c 100644 --- a/Changes +++ b/Changes @@ -1,3 +1,7 @@ +02May99======================================================================= +1. Added the mechanism for doing user spot filtering for spots in the cluster +(no user control just yet - but sysops can do it). +2. Fixed problem with nodes sending out the node lists of isolated nodes. 30Apr99======================================================================= 1. Try to make it even more AK1A friendly by putting the node list out in the 'correct' order. diff --git a/cmd/dx.pl b/cmd/dx.pl index bda2979e..dd780699 100644 --- a/cmd/dx.pl +++ b/cmd/dx.pl @@ -87,11 +87,13 @@ if (grep $_ eq $spotted, @DXProt::baddx) { my @spot = Spot::add($freq, $spotted, $main::systime, $line, $spotter, $main::mycall); if (@spot) { # send orf to the users - my $buf = Spot::formatb($freq, $spotted, $main::systime, $line, $spotter); - DXProt::broadcast_users($buf, 'dx', \@spot); + DXProt::send_dx_spot($self, DXProt::pc11($spotter, $freq, $spotted, $line), @spot); + +# my $buf = Spot::formatb($freq, $spotted, $main::systime, $line, $spotter); +# DXProt::broadcast_users("$buf\a\a", 'dx', $spot[0]); # send it orf to the cluster (hang onto your tin helmets) - DXProt::broadcast_all_ak1a(DXProt::pc11($spotter, $freq, $spotted, $line), $DXProt::me); +# DXProt::broadcast_all_ak1a(DXProt::pc11($spotter, $freq, $spotted, $line), $DXProt::me); } } diff --git a/perl/DXProt.pm b/perl/DXProt.pm index 7dc55189..b446b713 100644 --- a/perl/DXProt.pm +++ b/perl/DXProt.pm @@ -230,35 +230,7 @@ sub normal return if $pcno == 26; # send out the filtered spots - my @dxchan = get_all_ak1a(); - my $dxchan; - - # send it if it isn't the except list and isn't isolated and still has a hop count - # taking into account filtering and so on - foreach $dxchan (@dxchan) { - next if $dxchan == $self; - my $routeit; - my ($filter, $hops) = Filter::it($dxchan->{spotfilter}, @spot, $self->{call} ) if $dxchan->{spotfilter}; - if ($hops) { - $routeit = $line; - $routeit =~ s/\^H\d+\^\~$/\^H$hops\^\~/; - } else { - $routeit = adjust_hops($dxchan, $line); # adjust its hop count by node name - next unless $routeit; - } - if ($filter) { - $dxchan->send($routeit) if $routeit; - } else { - $dxchan->send($routeit) unless $dxchan->{isolate} || $self->{isolate}; - } - } - - # send orf to the users - if (@spot) { - my $buf = Spot::formatb($field[1], $field[2], $d, $text, $spotter); - broadcast_users("$buf\a\a", 'dx', $spot[0]); - } - + send_dx_spot($self, $line, @spot) if @spot; return; } @@ -711,6 +683,40 @@ sub finish # # some active measures # +sub send_dx_spot +{ + my $self = shift; + my $line = shift; + my @dxchan = DXChannel->get_all(); + my $dxchan; + + # send it if it isn't the except list and isn't isolated and still has a hop count + # taking into account filtering and so on + foreach $dxchan (@dxchan) { + my $routeit; + my ($filter, $hops) = Filter::it($dxchan->{spotfilter}, @_, $self->{call} ) if $dxchan->{spotfilter}; + if ($dxchan->is_ak1a) { + next if $dxchan == $self; + if ($hops) { + $routeit = $line; + $routeit =~ s/\^H\d+\^\~$/\^H$hops\^\~/; + } else { + $routeit = adjust_hops($dxchan, $line); # adjust its hop count by node name + next unless $routeit; + } + if ($filter) { + $dxchan->send($routeit) if $routeit; + } else { + $dxchan->send($routeit) unless $dxchan->{isolate} || $self->{isolate}; + + } + } elsif ($dxchan->is_user) { + my $buf = Spot::formatb($_[0], $_[1], $_[2], $_[3], $_[4]); + $buf .= "\a\a" if $dxchan->beep; + $dxchan->send($buf); + } + } +} sub send_local_config { @@ -728,9 +734,9 @@ sub send_local_config # and are not themselves isolated, this to make sure that isolated nodes # don't appear outside of this node @nodes = DXNode::get_all(); - @nodes = grep { $_->dxchan != $self } @nodes; + @nodes = grep { $_->dxchan != $self && !$_->dxchan->{isolate} } @nodes; @nodes = grep { $_->{call} ne $main::mycall } @nodes; - @localnodes = grep { $_->dxchan->{call} eq $_->{call} && !$_->dxchan->{isolate} } @nodes if @nodes; + @localnodes = grep { $_->dxchan->{call} eq $_->{call} } @nodes if @nodes; unshift @localnodes, DXCluster->get_exact($main::mycall); @remotenodes = grep { $_->dxchan->{call} ne $_->{call} } @nodes if @nodes; } diff --git a/perl/cluster.pl b/perl/cluster.pl index 88131b21..ebe7ce0a 100755 --- a/perl/cluster.pl +++ b/perl/cluster.pl @@ -67,7 +67,7 @@ package main; @inqueue = (); # the main input queue, an array of hashes $systime = 0; # the time now (in seconds) -$version = "1.26"; # the version no of the software +$version = "1.27"; # the version no of the software $starttime = 0; # the starting time of the cluster $lockfn = "cluster.lock"; # lock file name -- 2.43.0