+10Sep01=======================================================================
+1. clear/* node_default and user_default now work.
+2. in acc or rej/* you can now use (comma separated) prefixes as well as lists
+of numbers for things like *_dxcc, *_itu and *_cq (eg: by_dxcc ve,w); just
+remember that countries like ve and w have lots of zones and itus!
+3. Added all the clear/* commands to help and added some comments about 2.
+4. All filters (including *_default ones) are now reinstalled on channels in
+realtime, so changing a filter does NOT require a disconnect and reconnect
+cycle anymore.
09Sep01=======================================================================
1. Add show/dxstats command
2. Add show/hfstats command
info <string> eg: iota or qsl
by <prefixes> eg: G,M,2
origin <prefixes>
- origin_dxcc <numbers> eg: 61,62 (from eg: sh/pre G)
- origin_itu <numbers>
- origin_zone <numbers>
- by_dxcc <numbers>
- by_itu <numbers>
- by_zone <numbers>
+ origin_dxcc <prefixes or numbers> eg: 61,62 (from eg: sh/pre G)
+ origin_itu <prefixes or numbers> or: G,GM,GW
+ origin_zone <prefixes or numbers>
+ by_dxcc <prefixes or numbers>
+ by_itu <prefixes or numbers>
+ by_zone <prefixes or numbers>
channel <prefixes>
wx 1 filter WX announces
dest <prefixes> eg: 6MUK,WDX (distros)
You can use any of the following things in this line:-
call <prefixes> the callsign of the thingy
- call_dxcc <numbers> eg: 61,62 (from eg: sh/pre G)
- call_itu <numbers>
- call_zone <numbers>
+ call_dxcc <prefixes or numbers> eg: 61,62 (from eg: sh/pre G)
+ call_itu <prefixes or numbers> or: G,GM,GW
+ call_zone <prefixes or numbers>
origin <prefixes> really the interface it came in on
- origin_dxcc <numbers> eg: 61,62 (from eg: sh/pre G)
- origin_itu <numbers>
- origin_zone <numbers>
+ origin_dxcc <prefixes or numbers> eg: 61,62 (from eg: sh/pre G)
+ origin_itu <prefixes or numbers> or: G,GM,GW
+ origin_zone <prefixes or numbers>
some examples:-
call <prefixes> eg: G,PA,HB9
info <string> eg: iota or qsl
by <prefixes>
- call_dxcc <numbers> eg: 61,62 (from eg: sh/pre G)
- call_itu <numbers>
- call_zone <numbers>
- by_dxcc <numbers>
- by_itu <numbers>
- by_zone <numbers>
+ call_dxcc <prefixes or numbers> eg: 61,62 (from eg: sh/pre G)
+ call_itu <prefixes or numbers> or: G,GM,GW
+ call_zone <prefixes or numbers>
+ by_dxcc <prefixes or numbers>
+ by_itu <prefixes or numbers>
+ by_zone <prefixes or numbers>
origin <prefixes>
channel <prefixes>
by <prefixes> eg: G,M,2
origin <prefixes>
- origin_dxcc <numbers> eg: 61,62 (from eg: sh/pre G)
- origin_itu <numbers>
- origin_zone <numbers>
- by_dxcc <numbers>
- by_itu <numbers>
- by_zone <numbers>
+ origin_dxcc <prefixes or numbers> eg: 61,62 (from eg: sh/pre G)
+ origin_itu <prefixes or numbers> or: G,GM,GW
+ origin_zone <prefixes or numbers>
+ by_dxcc <prefixes or numbers>
+ by_itu <prefixes or numbers>
+ by_zone <prefixes or numbers>
channel <prefixes>
There are no examples because WCY Broadcasts only come from one place and
by <prefixes> eg: G,M,2
origin <prefixes>
- origin_dxcc <numbers> eg: 61,62 (from eg: sh/pre G)
- origin_itu <numbers>
- origin_zone <numbers>
- by_dxcc <numbers>
- by_itu <numbers>
- by_zone <numbers>
+ origin_dxcc <prefixes or numbers> eg: 61,62 (from eg: sh/pre G)
+ origin_itu <prefixes or numbers> or: G,GM,GW
+ origin_zone <prefixes or numbers>
+ by_dxcc <prefixes or numbers>
+ by_itu <prefixes or numbers>
+ by_zone <prefixes or numbers>
channel <prefixes>
for example
Order is not important.
-=== 0^CLEAR/SPOTS [1|all]^Clear a spot filter line
+=== 0^CLEAR/ANNOUNCE [1|all]^Clear a announce filter line
+This command allows you to clear (remove) a line in a annouce filter or to
+remove the whole filter.
+
+see CLEAR/SPOTS for a more detailed explanation.
+
+=== 8^CLEAR/ANNOUNCE [input] <callsign> [0-9|all]^Clear a announce filter line
+A sysop can clear an input or normal output filter for a user or the
+node_default or user_default.
+
+=== 0^CLEAR/ROUTE [1|all]^Clear a route filter line
+This command allows you to clear (remove) a line in a route filter or to
+remove the whole filter.
+
+see CLEAR/SPOTS for a more detailed explanation.
+
+=== 8^CLEAR/ROUTE [input] <callsign> [0-9|all]^Clear a route filter line
+A sysop can clear an input or normal output filter for a user or the
+node_default or user_default.
+
+=== 0^CLEAR/SPOTS [0-9|all]^Clear a spot filter line
This command allows you to clear (remove) a line in a spot filter or to
remove the whole filter.
the filter will be completely removed.
+=== 8^CLEAR/SPOTS [input] <callsign> [0-9|all]^Clear a spot filter line
+A sysop can clear an input or normal output filter for a user or the
+node_default or user_default.
+
+=== 0^CLEAR/WCY [1|all]^Clear a WCY filter line
+This command allows you to clear (remove) a line in a WCY filter or to
+remove the whole filter.
+
+see CLEAR/SPOTS for a more detailed explanation.
+
+=== 8^CLEAR/WCY [input] <callsign> [0-9|all]^Clear a WCY filter line
+A sysop can clear an input or normal output filter for a user or the
+node_default or user_default.
+
+=== 0^CLEAR/WWV [1|all]^Clear a WWV filter line
+This command allows you to clear (remove) a line in a WWV filter or to
+remove the whole filter.
+
+see CLEAR/SPOTS for a more detailed explanation.
+
+=== 8^CLEAR/WWV [input] <callsign> [0-9|all]^Clear a WWV filter line
+A sysop can clear an input or normal output filter for a user or the
+node_default or user_default.
+
=== 5^CONNECT <callsign>^Start a connection to another DX Cluster
Start a connection process that will culminate in a new connection to the
DX cluster <callsign>. This process creates a new 'client' process which will
use the script in /spider/connect/<callsign> to effect the 'chat' exchange
necessary to traverse the network(s) to logon to the cluster <callsign>.
-=== 9^DELELE/USER <callsign> ...^Delete this user from the User Database
+=== 9^DELETE/USER <callsign> ...^Delete this user from the User Database
This command will completely remove a one or more users from the database.
+
+There is NO SECOND CHANCE.
+
It goes without saying that you should use this command CAREFULLY!
=== 0^DBAVAIL^Show a list of all the Databases in the system
clear/spots all
+There are similar CLEAR commands for the other filters:-
+
+ clear/announce
+ clear/wcy
+ clear/wwv
+
ADVANCED USERS:-
Once you are happy with the results you get, you may like to experiment.
info <string> eg: iota or qsl
by <prefixes> eg: G,M,2
origin <prefixes>
- origin_dxcc <numbers> eg: 61,62 (from eg: sh/pre G)
- origin_itu <numbers>
- origin_zone <numbers>
- by_dxcc <numbers>
- by_itu <numbers>
- by_zone <numbers>
+ origin_dxcc <prefixes or numbers> eg: 61,62 (from eg: sh/pre G)
+ origin_itu <prefixes or numbers> or: G,GM,GW
+ origin_zone <prefixes or numbers>
+ by_dxcc <prefixes or numbers>
+ by_itu <prefixes or numbers>
+ by_zone <prefixes or numbers>
channel <prefixes>
wx 1 filter WX announces
dest <prefixes> eg: 6MUK,WDX (distros)
call <prefixes> eg: G,PA,HB9
info <string> eg: iota or qsl
by <prefixes>
- call_dxcc <numbers> eg: 61,62 (from eg: sh/pre G)
- call_itu <numbers>
- call_zone <numbers>
- by_dxcc <numbers>
- by_itu <numbers>
- by_zone <numbers>
+ call_dxcc <prefixes or numbers> eg: 61,62 (from eg: sh/pre G)
+ call_itu <prefixes or numbers> or: G,GM,GW
+ call_zone <prefixes or numbers>
+ by_dxcc <prefixes or numbers>
+ by_itu <prefixes or numbers>
+ by_zone <prefixes or numbers>
origin <prefixes>
channel <prefixes>
You can use any of the following things in this line:-
call <prefixes> the callsign of the thingy
- call_dxcc <numbers> eg: 61,62 (from eg: sh/pre G)
- call_itu <numbers>
- call_zone <numbers>
+ call_dxcc <prefixes or numbers> eg: 61,62 (from eg: sh/pre G)
+ call_itu <prefixes or numbers> or: G,GM,GW
+ call_zone <prefixes or numbers>
origin <prefixes> really the interface it came in on
- origin_dxcc <numbers> eg: 61,62 (from eg: sh/pre G)
- origin_itu <numbers>
- origin_zone <numbers>
+ origin_dxcc <prefixes or numbers> eg: 61,62 (from eg: sh/pre G)
+ origin_itu <prefixes or numbers> or: G,GM,GW
+ origin_zone <prefixes or numbers>
some examples:-
by <prefixes> eg: G,M,2
origin <prefixes>
- origin_dxcc <numbers> eg: 61,62 (from eg: sh/pre G)
- origin_itu <numbers>
- origin_zone <numbers>
- by_dxcc <numbers>
- by_itu <numbers>
- by_zone <numbers>
+ origin_dxcc <prefixes or numbers> eg: 61,62 (from eg: sh/pre G)
+ origin_itu <prefixes or numbers> or: G,GM,GW
+ origin_zone <prefixes or numbers>
+ by_dxcc <prefixes or numbers>
+ by_itu <prefixes or numbers>
+ by_zone <prefixes or numbers>
channel <prefixes>
There are no examples because WCY Broadcasts only come from one place and
by <prefixes> eg: G,M,2
origin <prefixes>
- origin_dxcc <numbers> eg: 61,62 (from eg: sh/pre G)
- origin_itu <numbers>
- origin_zone <numbers>
- by_dxcc <numbers>
- by_itu <numbers>
- by_zone <numbers>
+ origin_dxcc <prefixes or numbers> eg: 61,62 (from eg: sh/pre G)
+ origin_itu <prefixes or numbers> or: G,GM,GW
+ origin_zone <prefixes or numbers>
+ by_dxcc <prefixes or numbers>
+ by_itu <prefixes or numbers>
+ by_zone <prefixes or numbers>
channel <prefixes>
for example
my $flag;
my $fno = 1;
my $call = $dxchan->call;
+my $f;
-my $f = lc shift @f if @f;
if ($self->priv >= 8) {
- if (is_callsign(uc $f)) {
- my $uref = DXUser->get(uc $f);
+ 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 = lc shift @f;
- if ($f eq 'input') {
- $flag = 'in';
- $f = shift @f if @f;
- }
+ if (@f && $f[0] eq 'input') {
+ shift @f;
+ $flag = 'in';
}
}
-$fno = $f if $f;
+$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 " : "";
my $flag;
my $fno = 1;
my $call = $dxchan->call;
+my $f;
-my $f = lc shift @f if @f;
if ($self->priv >= 8) {
- if (is_callsign(uc $f)) {
- my $uref = DXUser->get(uc $f);
+ 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 = lc shift @f;
- if ($f eq 'input') {
- $flag = 'in';
- $f = shift @f if @f;
- }
+ if (@f && $f[0] eq 'input') {
+ shift @f;
+ $flag = 'in';
}
}
-$fno = $f if $f;
+$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 " : "";
# $Id$
#
my ($self, $line) = @_;
-my @f = split(/\s+/, $line);
+my @f = split /\s+/, $line;
my @out;
my $dxchan = $self;
my $sort = 'spots';
my $f;
if ($self->priv >= 8) {
- if (is_callsign(uc $f[0])) {
+ 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[0] eq 'input') {
+ if (@f && $f[0] eq 'input') {
shift @f;
$flag = 'in';
}
}
-$fno = shift @f if @f && $f[0] =~ /^\d$/;
+$fno = shift @f if @f && $f[0] =~ /^\d|all$/;
my $filter = Filter::read_in($sort, $call, $flag);
Filter::delete($sort, $call, $flag, $fno);
my $flag;
my $fno = 1;
my $call = $dxchan->call;
+my $f;
-my $f = lc shift @f if @f;
if ($self->priv >= 8) {
- if (is_callsign(uc $f)) {
- my $uref = DXUser->get(uc $f);
+ 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 = lc shift @f;
- if ($f eq 'input') {
- $flag = 'in';
- $f = shift @f if @f;
- }
+ if (@f && $f[0] eq 'input') {
+ shift @f;
+ $flag = 'in';
}
}
-$fno = $f if $f;
+$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 " : "";
my $flag;
my $fno = 1;
my $call = $dxchan->call;
+my $f;
-my $f = lc shift @f if @f;
if ($self->priv >= 8) {
- if (is_callsign(uc $f)) {
- my $uref = DXUser->get(uc $f);
+ 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 = lc shift @f;
- if ($f eq 'input') {
- $flag = 'in';
- $f = shift @f if @f;
- }
+ if (@f && $f[0] eq 'input') {
+ shift @f;
+ $flag = 'in';
}
}
-$fno = $f if $f;
+$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 " : "";
['group', 't', 3],
['origin', 'c', 4],
['wx', 't', 5],
- ['channel', 'n', 6],
- ['by_dxcc', 'n', 7],
- ['by_itu', 'n', 8],
- ['by_zone', 'n', 9],
- ['origin_dxcc', 'n', 10],
- ['origin_itu', 'n', 11],
- ['origin_itu', 'n', 12],
+ ['channel', 'c', 6],
+ ['by_dxcc', 'nc', 7],
+ ['by_itu', 'ni', 8],
+ ['by_zone', 'nz', 9],
+ ['origin_dxcc', 'nc', 10],
+ ['origin_itu', 'ni', 11],
+ ['origin_zone', 'nz', 12],
], 'Filter::Cmd');
use vars qw($VERSION $BRANCH);
use DXUtil;
use DXDebug;
use Data::Dumper;
+use Prefix;
use strict;
$in = "in" if $name =~ s/^IN_//;
$name =~ s/.PL$//;
- my $dxchan = DXChannel->get($name);
- if ($dxchan) {
+ my $dxchan;
+ my @dxchan;
+ if ($name eq 'NODE_DEFAULT') {
+ @dxchan = DXChannel::get_all_nodes();
+ } elsif ($name eq 'USER_DEFAULT') {
+ @dxchan = DXChannel::get_all_users();
+ } else {
+ $dxchan = DXChannel->get($name);
+ push @dxchan, $dxchan if $dxchan;
+ }
+ foreach $dxchan (@dxchan) {
my $n = "$in$sort" . "filter";
- $dxchan->$n($remove ? undef : $self);
+ my $ref = $dxchan->$n;
+ if (!$ref || ($ref && uc $ref->{name} eq "$name.PL")) {
+ $dxchan->$n($remove ? undef : $self);
+ }
}
}
push @t, "\$r->[$fref->[2]]==$_";
}
$s .= "(" . join(' || ', @t) . ")";
+ } elsif ($fref->[1] =~ /^n[ciz]$/ ) { # for DXCC, ITU, CQ Zone
+ my @n;
+ my $cmd = $fref->[1];
+ foreach my $v (@val) {
+ if ($v =~ /^\d+$/) {
+ push @n, $v unless grep $_ eq $v, @n;
+ } else {
+ my @pre = Prefix::extract($v);
+ return ('numpre', $dxchan->msg('e27', $_)) unless @pre;
+ shift @pre;
+ foreach my $p (@pre) {
+ my $n = $p->dxcc if $cmd eq 'nc' ;
+ $n = $p->itu if $cmd eq 'ni' ;
+ $n = $p->cq if $cmd eq 'nz' ;
+ push @n, $n unless grep $_ eq $n, @n;
+ }
+ }
+ }
+ $s .= "(" . join(' || ', map {"\$r->[$fref->[2]]==$_"} @n) . ")";
} elsif ($fref->[1] eq 'r') {
my @t;
for (@val) {
# tag, sort, field, priv, special parser
['by', 'c', 7],
['origin', 'c', 8],
- ['channel', 'n', 9],
- ['by_dxcc', 'n', 10],
- ['by_itu', 'n', 11],
- ['by_zone', 'n', 12],
- ['origin_dxcc', 'c', 13],
- ['origin_itu', 'c', 14],
- ['origin_itu', 'c', 15],
+ ['channel', 'c', 9],
+ ['by_dxcc', 'nc', 10],
+ ['by_itu', 'ni', 11],
+ ['by_zone', 'nz', 12],
+ ['origin_dxcc', 'nc', 13],
+ ['origin_itu', 'ni', 14],
+ ['origin_zone', 'nz', 15],
], 'Filter::Cmd');
sub init
e24 => 'Sorry, Internet access is not enabled',
e25 => 'Sorry the value must be between $_[0] and $_[1]',
e26 => 'Too many concurrent errors, you are being disconnected',
+ e27 => '$_[0] not a numeric or a callsign prefix',
echoon => 'Echoing enabled',
echooff => 'Echoing disabled',
$filterdef = bless ([
# tag, sort, field, priv, special parser
['channel', 'c', 0],
- ['channel_dxcc', 'n', 1],
- ['channel_itu', 'n', 2],
- ['channel_zone', 'n', 3],
+ ['channel_dxcc', 'nc', 1],
+ ['channel_itu', 'ni', 2],
+ ['channel_zone', 'nz', 3],
['call', 'c', 4],
- ['call_dxcc', 'n', 5],
- ['call_itu', 'n', 6],
- ['call_zone', 'n', 7],
+ ['call_dxcc', 'nc', 5],
+ ['call_itu', 'ni', 6],
+ ['call_zone', 'nz', 7],
], 'Filter::Cmd');
['call', 'c', 1],
['info', 't', 3],
['by', 'c', 4],
- ['call_dxcc', 'n', 5],
- ['by_dxcc', 'n', 6],
+ ['call_dxcc', 'nc', 5],
+ ['by_dxcc', 'nc', 6],
['origin', 'c', 7, 9],
- ['call_itu', 'n', 8],
- ['call_zone', 'n', 9],
- ['by_itu', 'n', 10],
- ['by_zone', 'n', 11],
- ['channel', 'n', 12, 9],
+ ['call_itu', 'ni', 8],
+ ['call_zone', 'nz', 9],
+ ['by_itu', 'ni', 10],
+ ['by_zone', 'nz', 11],
+ ['channel', 'c', 12],
], 'Filter::Cmd');
# tag, sort, field, priv, special parser
['by', 'c', 11],
['origin', 'c', 12],
- ['channel', 'n', 13],
- ['by_dxcc', 'n', 14],
- ['by_itu', 'n', 15],
- ['by_zone', 'n', 16],
- ['origin_dxcc', 'c', 17],
- ['origin_itu', 'c', 18],
- ['origin_itu', 'c', 19],
+ ['channel', 'c', 13],
+ ['by_dxcc', 'nc', 14],
+ ['by_itu', 'ni', 15],
+ ['by_zone', 'nz', 16],
+ ['origin_dxcc', 'nc', 17],
+ ['origin_itu', 'ni', 18],
+ ['origin_zone', 'nz', 19],
], 'Filter::Cmd');