X-Git-Url: http://dxcluster.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2FDXProt.pm;h=0c23663c415bf111e30f935f668369304a3e0054;hb=bdc2552d39834c58fd06e18272ba653726f59e6f;hp=e986055692de4a2a00bca485b42a1d0c32b190bf;hpb=17f0b57add792391822d38116e89b33c1df4e2dd;p=spider.git diff --git a/perl/DXProt.pm b/perl/DXProt.pm index e9860556..0c23663c 100644 --- a/perl/DXProt.pm +++ b/perl/DXProt.pm @@ -32,6 +32,7 @@ use BadWords; use DXHash; use Route; use Route::Node; +use Script; use strict; @@ -43,7 +44,7 @@ $main::branch += $BRANCH; use vars qw($me $pc11_max_age $pc23_max_age $last_pc50 $last_hour $last10 %eph %pings %rcmds $ann_to_talk - %nodehops $baddx $badspotter $badnode $censorpc + %nodehops $baddx $badspotter $badnode $censorpc $rspfcheck $allowzero $decode_dk0wcy $send_opernam @checklist); $me = undef; # the channel id for this cluster @@ -61,6 +62,7 @@ $badspotter = new DXHash "badspotter"; $badnode = new DXHash "badnode"; $last10 = $last_pc50 = time; $ann_to_talk = 1; +$rspfcheck = 1; @checklist = ( @@ -272,6 +274,10 @@ sub start # send info to all logged in thingies $self->tell_login('loginn'); + + # run a script send the output to the debug file + my $script = new Script(lc $call) || new Script('node_default'); + $script->run($self) if $script; } # @@ -311,6 +317,9 @@ sub normal SWITCH: { if ($pcno == 10) { # incoming talk + # rsfp check + return if $rspfcheck and !$self->rspfcheck(0, $field[6], $field[1]); + # will we allow it at all? if ($censorpc) { my @bad; @@ -332,7 +341,7 @@ sub normal # 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 (AnnTalk::is_talk_candidate($from, $field[3]) && AnnTalk::dup($from, $to, $field[3])) { dbg("DXPROT: Dupe talk from announce, dropped") if isdbg('chanerr'); return; } @@ -343,7 +352,7 @@ sub normal $dxchan = DXChannel->get($to) unless $dxchan; if ($dxchan && $dxchan->is_user) { $field[3] =~ s/\%5E/^/g; - $dxchan->talk($$from, $to, $via, $field[3]); + $dxchan->talk($from, $to, $via, $field[3]); return; } @@ -354,17 +363,17 @@ sub normal if ($ref = Route::get($to)) { $vref = Route::Node::get($via) if $via; $vref = undef unless $vref && grep $to eq $_, $vref->users; - $ref->dxchan->talk($$from, $to, $vref ? $via : undef, $field[3], $field[6]); + $ref->dxchan->talk($from, $to, $vref ? $via : undef, $field[3], $field[6]); return; } # not visible here, send a message of condolence $vref = undef; - $ref = Route::get($$from); + $ref = Route::get($from); $vref = $ref = Route::Node::get($field[6]) unless $ref; if ($ref) { $dxchan = $ref->dxchan; - $dxchan->talk($main::mycall, $$from, $vref ? $vref->call : undef, $dxchan->msg('talknh', $to) ); + $dxchan->talk($main::mycall, $from, $vref ? $vref->call : undef, $dxchan->msg('talknh', $to) ); } return; } @@ -379,6 +388,9 @@ sub normal } } + # rsfp check + return if $rspfcheck and !$self->rspfcheck(1, $field[7], $field[6]); + # if this is a 'nodx' node then ignore it if ($badnode->in($field[7])) { dbg("PCPROT: Bad Node, dropped") if isdbg('chanerr'); @@ -508,6 +520,9 @@ sub normal } if ($pcno == 12) { # announces + + return if $rspfcheck and !$self->rspfcheck(1, $field[5], $field[1]); + # announce duplicate checking $field[3] =~ s/^\s+//; # remove leading blanks if (AnnTalk::dup($field[1], $field[2], $field[3])) { @@ -844,6 +859,8 @@ sub normal } } + return if $rspfcheck and !$self->rspfcheck(1, $field[8], $field[7]); + # do some de-duping my $d = cltounix($field[1], sprintf("%02d18Z", $field[2])); my $sfi = unpad($field[3]); @@ -969,7 +986,7 @@ sub normal # my $ref = Route::get($call) || Route->new($call); # return unless $self->in_filter_route($ref); - if ($field[3] eq $field[2]) { + if ($field[3] eq $field[2] || $field[3] =~ /^\s*$/) { dbg('PCPROT: invalid value') if isdbg('chanerr'); return; }