2. strip the top off each character in any text field of a Spot for duping.
3. Try to make the routing tables more accurate for users that login to
more than one node.
4. Make PC50s come out in one heap on all channels every 14 mins, instead of
on the 14th minute in the connection time for each channel. This should
reduce (slightly) the dups that are dumped.
+03Sep01=======================================================================
+1. make spot dups look back 5 mins.
+2. strip the top off each character in any text field of a Spot for duping.
+3. Try to make the routing tables more accurate for users that login to
+more than one node.
+4. Make PC50s come out in one heap on all channels every 14 mins, instead of
+on the 14th minute in the connection time for each channel. This should
+reduce (slightly) the dups that are dumped.
01Sep01=======================================================================
1. Change build number calc (hopefully for the last time)
27Aug01=======================================================================
command on the command line.
3. make set/node, set/spider and their friends unlock a node as well as make
them one.
-4. Make sh/log et al more efficient / less memory hungry
+4. Make sh/log et al more efficient / less memory hungry (and the display
+the correct way round!)
24Aug01=======================================================================
1. Allow badmsg to reject on interface callsign ('I')
20Aug01=======================================================================
my $dxchan;
foreach $dxchan (@dxchan) {
next if $dxchan == $self;
+ next if $dxchan->{call} eq $main::mycall;
$dxchan->send($dxchan->msg($m, $self->{call})) if $dxchan->{logininfo};
}
}
my $call = $self->call;
delete $self->{senddbg};
- my @rout = $main::routeroot->del_user($call);
- dbg("B/C PC17 on $main::mycall for: $call") if isdbg('route');
+ my $uref = Route::User::get($call);
+ my @rout;
+ if ($uref) {
+ @rout = $main::routeroot->del_user($uref);
+ dbg("B/C PC17 on $main::mycall for: $call") if isdbg('route');
+ } else {
+ confess "trying to disconnect a non existant user $call";
+ }
# issue a pc17 to everybody interested
DXProt::route_pc17($DXProt::me, $main::routeroot, @rout) if @rout;
sub check
{
my ($s, $t) = @_;
- return 1 if exists $d{$s};
+ return 1 if find($s);
+ add($s, $t);
+ return 0;
+}
+
+sub find
+{
+ return 1 if exists $d{$_[0]};
+}
+
+sub add
+{
+ my ($s, $t) = @_;
$t = $main::systime + $default unless $t;
$d{$s} = $t;
- return 0;
}
sub del
$main::build += $VERSION;
$main::branch += $BRANCH;
-use vars qw($me $pc11_max_age $pc23_max_age
+use vars qw($me $pc11_max_age $pc23_max_age $last_pc50
$last_hour $last10 %eph %pings %rcmds
%nodehops $baddx $badspotter $badnode $censorpc
$allowzero $decode_dk0wcy $send_opernam @checklist);
$baddx = new DXHash "baddx";
$badspotter = new DXHash "badspotter";
$badnode = new DXHash "badnode";
-$last10 = time;
+$last10 = $last_pc50 = time;
@checklist =
(
$r->flags($flags);
push @rout, $r;
}
- $r->addparent($ncall);
+ $r->addparent($parent);
} else {
push @rout, $parent->add_user($call, $flags);
}
dbg("PCPROT: Route::Node $ncall not in config") if isdbg('chanerr');
return;
}
+ my $uref = Route::User::get($ucall);
+ unless ($uref) {
+ dbg("PCPROT: Route::User $ucall not in config") if isdbg('chanerr');
+ return;
+ }
+
# input filter if required
return unless $self->in_filter_route($parent);
-
- my @rout = $parent->del_user($ucall);
+
+ my @rout = $parent->del_user($uref);
if (eph_dup($line)) {
dbg("PCPROT: dup PC17 detected") if isdbg('chanerr');
my $t = time;
my @dxchan = DXChannel->get_all();
my $dxchan;
+ my $pc50s;
+ # send out a pc50 on EVERY channel all at once
+ if ($t >= $last_pc50 + $DXProt::pc50_interval) {
+ $pc50s = pc50($me, scalar DXChannel::get_all_users);
+ eph_dup($pc50s);
+ $last_pc50 = $t;
+ }
+
foreach $dxchan (@dxchan) {
next unless $dxchan->is_node();
next if $dxchan == $me;
-
- # send a pc50 out on this channel
- $dxchan->{pc50_t} = $main::systime unless exists $dxchan->{pc50_t};
- if ($t >= $dxchan->{pc50_t} + $DXProt::pc50_interval) {
- my $s = pc50($me, scalar DXChannel::get_all_users);
- eph_dup($s);
- $dxchan->send($s);
- $dxchan->{pc50_t} = $t;
- }
+ # send the pc50
+ $dxchan->send($pc50s) if $pc50s;
+
# send a ping out on this channel
if ($dxchan->{pingint} && $t >= $dxchan->{pingint} + $dxchan->{lastping}) {
if ($dxchan->{nopings} <= 0) {
my $node = Route::Node::get($call);
my @rout;
if ($node) {
-# @rout = $node->del_nodes; # at the next level
@rout = $node->del($main::routeroot);
}
{
my $self = shift;
my $field = shift;
+ my @out;
foreach my $c (@_) {
- my $call = _getcall($c);
- unless (grep {$_ eq $call} @{$self->{$field}}) {
+ confess "Need a ref here" unless ref($c);
+
+ my $call = $c->{call};
+ unless (grep $_ eq $call, @{$self->{$field}}) {
push @{$self->{$field}}, $call;
dbg(ref($self) . " adding $call to " . $self->{call} . "->\{$field\}") if isdbg('routelow');
+ push @out, $c;
}
}
- return $self->{$field};
+ return @out;
}
sub _dellist
{
my $self = shift;
my $field = shift;
+ my @out;
foreach my $c (@_) {
- my $call = _getcall($c);
- if (grep {$_ eq $call} @{$self->{$field}}) {
+ confess "Need a ref here" unless ref($c);
+ my $call = $c->{call};
+ if (grep $_ eq $call, @{$self->{$field}}) {
$self->{$field} = [ grep {$_ ne $call} @{$self->{$field}} ];
dbg(ref($self) . " deleting $call from " . $self->{call} . "->\{$field\}") if isdbg('routelow');
+ push @out, $c;
}
}
- return $self->{$field};
+ return @out;
+}
+
+sub is_empty
+{
+ my $self = shift;
+ return @{$self->{$_[0]}} == 0;
}
#
sub max
{
+ count();
return $max;
}
confess "Route::add trying to add $call to myself" if $call eq $parent->{call};
my $self = get($call);
if ($self) {
- $self->_addparent($parent->{call});
- $parent->_addnode($call);
+ $self->_addparent($parent);
+ $parent->_addnode($self);
return undef;
}
- $parent->_addnode($call);
$self = $parent->new($call, @_);
+ $parent->_addnode($self);
return $self;
}
my $pref = shift;
# delete parent from this call's parent list
- my $pcall = $pref->{call};
- my $ncall = $self->{call};
- $pref->_delnode($ncall);;
- my $ref = $self->_delparent($pcall);
+ $pref->_delnode($self);
+ my @ref = $self->_delparent($pref);
my @nodes;
+ my $ncall = $self->{call};
# is this the last connection, I have no parents anymore?
- unless (@$ref) {
+ unless (@ref) {
foreach my $rcall (@{$self->{nodes}}) {
next if grep $rcall eq $_, @_;
my $r = Route::Node::get($rcall);
confess "Trying to add NULL User call to routing tables" unless $ucall;
- $self->_adduser($ucall);
-
- $self->{usercount} = scalar @{$self->{users}};
my $uref = Route::User::get($ucall);
my @out;
if ($uref) {
- $uref->addparent($self->{call});
+ @out = $uref->addparent($self);
} else {
- @out = Route::User->new($ucall, $self->{call}, @_);
+ $uref = Route::User->new($ucall, $self->{call}, @_);
+ @out = $uref;
}
+ $self->_adduser($uref);
+ $self->{usercount} = scalar @{$self->{users}};
+
return @out;
}
sub del_user
{
my $self = shift;
- my $ucall = shift;
- my $ref = Route::User::get($ucall);
- $self->_deluser($ucall);
- my @out = $ref->del($self) if $ref;
+ my $ref = shift;
+ my @out;
+
+ if ($ref) {
+ @out = $self->_deluser($ref);
+ $ref->del($self);
+ } else {
+ confess "tried to delete non-existant $ref->{call} from $self->{call}";
+ }
+ $self->{usercount} = scalar @{$self->{users}};
return @out;
}
sub max
{
+ count();
return $max;
}
{
my $self = shift;
my $pref = shift;
- my $ref = $self->delparent($pref->{call});
- return () if @$ref;
- my @out = delete $list{$self->{call}};
+ my @out = $self->delparent($pref);
return @out;
}
$text = substr($text, 0, $duplth) if length $text > $duplth;
unpad($text);
$text =~ s/[\\\%]\d+//g;
+ $text = pack("C*", map {$_ & 127} unpack("C*", $text));
$text =~ s/[^a-zA-Z0-9]//g;
+ for (0,60,120,180,240,300) {
+ my $dt = $d - $_;
+ my $dupkey = "X$freq|$call|$dt|\L$text";
+ return 1 if DXDupe::find($dupkey);
+ }
my $dupkey = "X$freq|$call|$d|\L$text";
- return DXDupe::check($dupkey, $main::systime+$dupage);
+ DXDupe::add($dupkey, $main::systime+$dupage);
+ return 0;
}
sub listdups