--- /dev/null
+#
+# accept/reject filter commands
+#
+# Copyright (c) 2000 Dirk Koopman G1TLH
+#
+#
+#
+
+my ($self, $line) = @_;
+my $type = 'accept';
+my $sort = 'rbn';
+
+my ($r, $filter, $fno) = $RBN::filterdef->cmd($self, $sort, $type, $line);
+return (1, $r ? $filter : $self->msg('filter1', $fno, $filter->{name}));
--- /dev/null
+#
+# clear filters commands
+#
+# Copyright (c) 2000 Dirk Koopman G1TLH
+#
+#
+#
+my ($self, $line) = @_;
+my @f = split /\s+/, $line;
+my @out;
+my $dxchan = $self;
+my $sort = 'rbn';
+my $flag;
+my $fno = 1;
+my $call = $dxchan->call;
+my $f;
+
+if ($self->priv >= 8) {
+ if (@f && is_callsign(uc $f[0])) {
+ $f = uc shift @f;
+ my $uref = DXUser::get($f);
+ $call = $uref->call if $uref;
+ } elsif (@f && lc $f[0] eq 'node_default' || lc $f[0] eq 'user_default') {
+ $call = lc shift @f;
+ }
+ if (@f && $f[0] eq 'input') {
+ shift @f;
+ $flag = 'in';
+ }
+}
+
+$fno = shift @f if @f && $f[0] =~ /^\d|all$/;
+
+my $filter = Filter::read_in($sort, $call, $flag);
+Filter::delete($sort, $call, $flag, $fno);
+$flag = $flag ? "input " : "";
+push @out, $self->msg('filter4', $flag, $sort, $fno, $call);
+return (1, @out);
--- /dev/null
+#
+# accept/reject filter commands
+#
+# Copyright (c) 2000 Dirk Koopman G1TLH
+#
+#
+#
+
+my ($self, $line) = @_;
+my $type = 'reject';
+my $sort = 'rbn';
+
+my ($r, $filter, $fno) = $RBN::filterdef->cmd($self, $sort, $type, $line);
+return (0, $r ? $filter : $self->msg('filter1', $fno, $filter->{name}));
if (@f) {
push @in, @f;
} else {
- push @in, qw(route ann spots wcy wwv);
+ push @in, qw(route ann spots wcy wwv rbn);
}
my $sort;
wcyfilter => '5,WCY Filt-out',
spotsfilter => '5,Spot Filt-out',
routefilter => '5,Route Filt-out',
+ rbnfilter => '5,RBN Filt-out',
pc92filter => '5,PC92 Route Filt-out',
inannfilter => '5,Ann Filt-inp',
inwwvfilter => '5,WWV Filt-inp',
inwcyfilter => '5,WCY Filt-inp',
inspotsfilter => '5,Spot Filt-inp',
inroutefilter => '5,Route Filt-inp',
+ inrbnfilter => '5,RBN Filt-inp',
inpc92filter => '5,PC92 Route Filt-inp',
passwd => '9,Passwd List,yesno',
pingint => '5,Ping Interval ',
if ($sort eq 'dx') {
next unless $dxchan->{dx};
- ($filter) = $dxchan->{spotsfilter}->it(@{$fref}) if ref $fref;
- next unless $filter;
- }
- if ($sort eq 'rbn') {
- next unless $dxchan->{dx}; # this is deliberate!
- ($filter) = $dxchan->{spotsfilter}->it(@{$fref}) if ref $fref;
+ ($filter) = $dxchan->{spotsfilter}->it($fref) if $dxchan->{spotsfilter} && ref $fref;
next unless $filter;
}
next if $sort eq 'ann' && !$dxchan->{ann} && $s !~ /^To\s+LOCAL\s+de\s+(?:$main::myalias|$main::mycall)/i;
$self->{annfilter} = Filter::read_in('ann', $call, 0)
|| Filter::read_in('ann', $nossid, 0)
|| Filter::read_in('ann', 'user_default', 0) ;
+ $self->{rbnfilter} = Filter::read_in('rbn', $call, 0)
+ || Filter::read_in('rbn', $nossid, 0)
+ || Filter::read_in('rbn', 'user_default', 0);
# clean up qra locators
my $qra = $user->qra;
my $hops = $self->{hops} if exists $self->{hops};
if (isdbg('filter')) {
+ my $call = $self->{name};
my $args = join '\',\'', map {defined $_ ? $_ : 'undef'} (ref $_[0] ? @{$_[0]} : @_);
my $true = $r ? "OK " : "REJ";
my $sort = $self->{sort};
my $dir = $self->{name} =~ /^in_/i ? "IN " : "OUT";
-
+
+ $call =~ s/\.PL$//i;
my $h = $hops || '';
- dbg("$true $dir: $type/$sort with $asc on '$args' $h") if isdbg('filter');
+ dbg("Filter: $call $true $dir: $type/$sort with '$asc' on '$args' $h") if isdbg('filter');
}
return ($r, $hops);
}
$r = $filter->write;
return (1,$r) if $r;
-
+
+ $filter->install(1); # 'delete'
$filter->install;
return (0, $filter, $fno);
use Math::Round qw(nearest);
use Date::Parse;
use Time::HiRes qw(clock_gettime CLOCK_REALTIME);
+use Spot;
our @ISA = qw(DXChannel);
our $dwelltime = 6; # the amount of time to wait for duplicates before issuing
# a spot to the user (no doubt waiting with bated breath).
+our $filterdef = $Spot::filterdef; # we use the same filter as the Spot system. Can't think why.
+
sub new
{
# do we have it?
my $spot = $spots->{$sp};
- $spot = $spots->{$spp}, $sp = $spp, dbg('RBN: SPP using $spp for $sp') if !$spot && exists $spots->{$spp};
- $spot = $spots->{$spm}, $sp = $spm, dbg('RBN: SPM using $spm for $sp') if !$spot && exists $spots->{$spm};
+ $spot = $spots->{$spp}, $sp = $spp, dbg(qq{RBN: SPP using $spp for $sp}) if !$spot && exists $spots->{$spp};
+ $spot = $spots->{$spm}, $sp = $spm, dbg(qq{RBN: SPM using $spm for $sp}) if !$spot && exists $spots->{$spm};
# if we have one and there is only one slot and that slot's time isn't expired for respot then return
++$zone{$s[11]}; # save the spotter's zone
++$qrg{$s[0]}; # and the qrg
- # save the highest strength one
- if ($r->[4] < $strength) {
- $strength = $r->[4];
- $saver = \@s;
- dbg("RBN: STRENGTH call: $s[1] qrg: $s[0] origin: $s[4] dB: $r->[4]") if isdbg 'rbn';
- }
my $filter = 0;
last;
}
+ # save the lowest strength one
+ if ($r->[4] < $strength) {
+ $strength = $r->[4];
+ $saver = \@s;
+ dbg("RBN: STRENGTH call: $s[1] qrg: $s[0] origin: $s[4] dB: $r->[4]") if isdbg 'rbn';
+ }
}
if ($saver) {