my $n = uc shift;
my $t = shift || time;
$self->{$n} = $t;
+
+ # also add the base version if it has some ssid on it
+ my $nn = $n;
+ $nn =~ s|(?:-\d+)?(?:/\w)?$||;
+ $self->{$nn} = $t unless $n eq $nn;
}
sub del
{
my $self = shift;
my $n = uc shift;
+ my $exact = shift;
delete $self->{$n};
+ return if $exact;
+
+ my $nn = $n;
+ $nn =~ s|(?:-\d+)?(?:/\w)?$||;
+ my @ssid = (0..99);
+ delete $self->{"$nn-$_"} for @ssid;
}
+
sub in
{
my $self = shift;
my $n = uc shift;
+ my $exact = shift;
+
+ return 1 if exists $self->{$n};
+ return 0 if $exact;
+ $n =~ s/-\d+$//;
return exists $self->{$n};
}
foreach $f (@f) {
- if ($self->in($f)) {
+ if ($self->in($f, 1)) {
push @out, $dxchan->msg('hasha',uc $f, $self->{name});
next;
}
- $self->add($f);
+ $self->add($f, 1);
push @out, $dxchan->msg('hashb', uc $f, $self->{name});
}
$self->put;
foreach $f (@f) {
- unless ($self->in($f)) {
+ unless ($self->in($f, 1)) {
push @out, $dxchan->msg('hashd', uc $f, $self->{name});
next;
}
- $self->del($f);
+ $self->del($f, 1);
push @out, $dxchan->msg('hashc', uc $f, $self->{name});
}
$self->put;
$eph_pc15_restime $pc9x_past_age $pc9x_dupe_age
$pc10_dupe_age $pc92_slug_changes $last_pc92_slug
$pc92Ain $pc92Cin $pc92Din $pc92Kin $pc9x_time_tolerance
- $pc92filterdef $senderverify $pc11_dwell_time $pc61_extract_route $pc92_ad_enabled $pc92c_ipaddr_enabled
+ $pc92filterdef $senderverify $pc11_dwell_time $pc61_extract_route
+ $pc92_ad_enabled $pc92c_ipaddr_enabled
+ $preserve_node_ssid
);
$pc9x_dupe_age = 60; # catch loops of circular (usually) D records
$pc11_dwell_time = 2; # number of seconds to wait for a PC61 to come to substitute the PC11
$pc61_extract_route = 0; # generate missing user route entry and IP address from passing PC61s
+$preserve_node_ssid = 0; # With the changes to badnode set this to 1 to preserve badnode ssids
$pc92filterdef = bless ([
# tag, sort, field, priv, special parser
}
# if this is a 'nodx' node then ignore it
- if ($badnode->in($pc->[6]) || ($via && $badnode->in($via))) {
+ if ($badnode->in($pc->[6], $preserve_node_ssid) || ($via && $badnode->in($via, $preserve_node_ssid))) {
dbg($line) if isdbg('nologchan');
dbg("PCPROT: Bad Node $pc->[6]/$via, dropped");
return;
}
- my $nossid = $from;
- $nossid =~ s/-\d+$//;
- if ($badspotter->in($nossid)) {
+ if ($badspotter->in($from)) {
dbg($line) if isdbg('nologchan');
- dbg("PCPROT: Bad Spotter $nossid, dropped");
+ dbg("PCPROT: Bad Spotter $from, dropped");
return;
}
# if this is a 'nodx' node then ignore it
- if ($badnode->in($pc->[7])) {
+ if ($badnode->in($pc->[7], $preserve_node_ssid)) {
dbg($line) if isdbg('nologchan');
dbg("PCPROT: Bad Node $pc->[7], dropped");
return;
my $nossid = $pc->[6];
$nossid =~ s/-\d+$//;
+ # is this is a 'bad spotter' or an unknown user then ignore it.
+ if ($badspotter->in($nossid)) {
+ dbg($line) if isdbg('nologchan');
+ dbg("PCPROT: Bad Spotter $nossid, dropped");
+ return;
+ }
+
my @spot = Spot::prepare($pc->[1], $pc->[2], $d, $pc->[5], $nossid, $pc->[7], $pc->[8]);
# $f0 = frequency
# $f14 = ip address
- # is this is a 'bad spotter' or an unknown user then ignore it.
- if ($badspotter->in($nossid)) {
- dbg($line) if isdbg('nologchan');
- dbg("PCPROT: Bad Spotter $nossid, dropped");
- return;
- }
-
# global spot filtering on INPUT
if ($self->{inspotsfilter}) {
my ($filter, $hops) = $self->{inspotsfilter}->it(@spot);
$pc->[3] =~ s/^\s+//; # remove leading blanks
# if this is a 'nodx' node then ignore it
- if ($badnode->in($pc->[5])) {
+ if ($badnode->in($pc->[5], $preserve_node_ssid)) {
dbg($line) if isdbg('nologchan');
dbg("PCPROT: Bad Node $pc->[5], dropped");
return;
}
# if this is a 'bad spotter' user then ignore it
- my $nossid = $pc->[1];
- $nossid =~ s/-\d+$//;
- if ($badspotter->in($nossid)) {
+ if ($badspotter->in($pc->[1])) {
dbg($line) if isdbg('nologchan');
- dbg("PCPROT: Bad Spotter $nossid, dropped");
+ dbg("PCPROT: Bad Spotter $pc->[1], dropped");
return;
}
dbg($s);
}
+ # if this is a 'bad node' user then ignore it
+ if ($badnode->in($onode, $preserve_node_ssid)) {
+ dbg($line) if isdbg('nologchan');
+ dbg("PCPROT: Bad Node $onode, dropped");
+ return;
+ }
+
# if this is a 'bad spotter' user then ignore it
- my $nossid = $from;
- $nossid =~ s/-\d+$//;
- if ($badspotter->in($nossid)) {
+ if ($badspotter->in($from)) {
dbg($line) if isdbg('nologchan');
- dbg("PCPROT: Bad Spotter $nossid, dropped");
+ dbg("PCPROT: Bad Spotter $from, dropped");
return;
}