19Aug01=======================================================================
1. Fix rcmds
2. make isolation when there are no filters present work again?
+3. dup check PC16/17/19/21 !
17Aug01=======================================================================
1. Sort out PC41 handling to include type 5 records for QRA locators and also
remove all filtering (but retain ephemeral dup checking).
if ($pcno == 16) { # add a user
+ if (eph_dup($line)) {
+ dbg("PCPROT: dup PC16 detected") if isdbg('chanerr');
+ return;
+ }
+
# general checks
my $dxchan;
my $ncall = $field[1];
my ($call, $conf, $here) = $field[$i] =~ /^(\S+) (\S) (\d)/o;
next unless $call && $conf && defined $here && is_callsign($call);
next if $call eq $main::mycall;
+
+ eph_del_regex("^PC17\^$call\^$ncall");
$conf = $conf eq '*';
my $dxchan;
my $ncall = $field[2];
my $ucall = $field[1];
+ if (eph_dup($line)) {
+ dbg("PCPROT: dup PC17 detected") if isdbg('chanerr');
+ return;
+ }
+
+ eph_del_regex("^PC16.*$ncall.*$ucall");
+
if ($ncall eq $main::mycall) {
dbg("PCPROT: trying to alter config on this node from outside!") if isdbg('chanerr');
return;
my $i;
my $newline = "PC19^";
+ if (eph_dup($line)) {
+ dbg("PCPROT: dup PC19 detected") if isdbg('chanerr');
+ return;
+ }
+
# new routing list
my @rout;
my $parent = Route::Node::get($self->{call});
my $conf = $field[$i+2];
my $ver = $field[$i+3];
next unless defined $here && defined $conf && is_callsign($call);
+
+ eph_del_regex("^PC21\^$call");
+
# check for sane parameters
$ver = 5000 if $ver eq '0000';
next if $ver < 5000; # only works with version 5 software
}
if ($pcno == 21) { # delete a cluster from the list
+ if (eph_dup($line)) {
+ dbg("PCPROT: dup PC21 detected") if isdbg('chanerr');
+ return;
+ }
+
my $call = uc $field[1];
+
+ eph_del_regex("^PC19.*$call");
+
my @rout;
my $parent = Route::Node::get($self->{call});
unless ($parent) {
return undef;
}
+sub eph_del_regex
+{
+ my $regex = shift;
+ my ($key, $val);
+ while (($key, $val) = each %eph) {
+ if ($key =~ m{$regex}) {
+ delete $eph{$key};
+ }
+ }
+}
+
sub eph_clean
{
my ($key, $val);