use vars qw($VERSION $BRANCH);
$VERSION = sprintf( "%d.%03d", q$Revision$ =~ /(\d+)\.(\d+)/ );
-$BRANCH = sprintf( "%d.%03d", q$Revision$ =~ /\d+\.\d+\.(\d+)\.(\d+)/ ) || 0;
+$BRANCH = sprintf( "%d.%03d", q$Revision$ =~ /\d+\.\d+\.(\d+)\.(\d+)/ || (0,0));
$main::build += $VERSION;
$main::branch += $BRANCH;
sub init
{
- my $user = DXUser->get($main::mycall);
- $DXProt::myprot_version += $main::version*100;
- $main::me = DXProt->new($main::mycall, 0, $user);
- $main::me->{here} = 1;
- $main::me->{state} = "indifferent";
do "$main::data/hop_table.pl" if -e "$main::data/hop_table.pl";
confess $@ if $@;
- $main::me->{sort} = 'S'; # S for spider
- $main::me->{priv} = 9;
- $main::me->{metric} = 0;
- $main::me->{pingave} = 0;
-
-# $Route::Node::me->adddxchan($main::me);
}
#
# send initialisation string
unless ($self->{outbound}) {
- $self->send(pc18());
+ $self->sendinit;
}
$self->state('init');
$script->run($self) if $script;
}
+#
+# send outgoing 'challenge'
+#
+
+sub sendinit
+{
+ my $self = shift;
+ $self->send(pc18());
+}
+
#
# This is the normal pcxx despatcher
#
$to = $field[2];
}
+ # if this is a 'nodx' node then ignore it
+ if ($badnode->in($field[6]) || ($via && $badnode->in($via))) {
+ dbg("PCPROT: Bad Node, dropped") if isdbg('chanerr');
+ return;
+ }
+
+ # if this is a 'bad spotter' user then ignore it
+ my $nossid = $from;
+ $nossid =~ s/-\d+$//;
+ if ($badspotter->in($nossid)) {
+ dbg("PCPROT: Bad Spotter, dropped") if isdbg('chanerr');
+ return;
+ }
+
# if we are converting announces to talk is it a dup?
if ($ann_to_talk) {
if (AnnTalk::is_talk_candidate($from, $field[3]) && AnnTalk::dup($from, $to, $field[3])) {
}
# if this is a 'bad spotter' user then ignore it
- if ($badspotter->in($field[6])) {
+ my $nossid = $field[6];
+ $nossid =~ s/-\d+$//;
+ if ($badspotter->in($nossid)) {
dbg("PCPROT: Bad Spotter, dropped") if isdbg('chanerr');
return;
}
}
}
+ # if this is a 'nodx' node then ignore it
+ if ($badnode->in($field[5])) {
+ dbg("PCPROT: Bad Node, dropped") if isdbg('chanerr');
+ return;
+ }
+
+ # if this is a 'bad spotter' user then ignore it
+ my $nossid = $field[1];
+ $nossid =~ s/-\d+$//;
+ if ($badspotter->in($nossid)) {
+ dbg("PCPROT: Bad Spotter, dropped") if isdbg('chanerr');
+ return;
+ }
+
if ($field[2] eq '*' || $field[2] eq $main::mycall) {
if ($pcno == 18) { # link request
$self->state('init');
+ # record the type and version offered
+ if ($field[1] =~ /DXSpider Version: (\d+\.\d+) Build: (\d+\.\d+)/) {
+ $self->version(53 + $1);
+ $self->user->version(53 + $1);
+ $self->build(0 + $2);
+ $self->user->build(0 + $2);
+ unless ($self->is_spider) {
+ $self->user->sort('S');
+ $self->user->put;
+ $self->sort('S');
+ }
+ } else {
+ $self->version(50.0);
+ $self->version($field[2] / 100) if $field[2] && $field[2] =~ /^\d+$/;
+ $self->user->version($self->version);
+ }
+
# first clear out any nodes on this dxchannel
my $parent = Route::Node::get($self->{call});
my @rout = $parent->del_nodes;
} else {
$tochan->{pingave} = $tochan->{pingave} + (($t - $tochan->{pingave}) / 6);
}
-# my $st;
-# for (@{$tochan->{pingtime}}) {
-# $st += $_;
-# }
-# $tochan->{pingave} = $st / @{$tochan->{pingtime}};
$tochan->{nopings} = $nopings; # pump up the timer
}
}
return;
}
+ if ($pcno == 90) { # new style PC16,17,19,21
+ return;
+ }
}
# if get here then rebroadcast the thing with its Hop count decremented (if
next unless $dxchan->is_node();
next if $dxchan == $main::me;
- # send the pc50
+ # send the pc50 or PC90
$dxchan->send($pc50s) if $pc50s;
# send a ping out on this channel
# some active measures
#
+
sub send_dx_spot
{
my $self = shift;
unshift @localnodes, $main::routeroot;
}
+
send_route($self, \&pc19, scalar(@localnodes)+scalar(@remotenodes), @localnodes, @remotenodes);
# get all the users connected on the above nodes and send them out
foreach $dxchan (@dxchan) {
next if $dxchan == $self;
next if $dxchan == $main::me;
+ next if $dxchan->user->wantnp;
+
$dxchan->send_route($generate, @_);
}
}
broadcast_route($self, \&pc50, 1, @_);
}
+sub route_pc90
+{
+ my $self = shift;
+ broadcast_route($self, \&pc90, 1, @_);
+}
+
sub in_filter_route
{
my $self = shift;