mirror of
git://scm.dxcluster.org/scm/spider
synced 2024-09-21 07:47:10 +00:00
add DXCIDR, fix version no tracking
Add more mojo code compatibility
This commit is contained in:
parent
66a5726687
commit
f63d598af3
12
cmd/dx.pl
12
cmd/dx.pl
@ -93,14 +93,18 @@ my $callnoid = basecall($self->{call});
|
||||
#$DB::single = 1;
|
||||
|
||||
if ($DXProt::baddx->in($spotted)) {
|
||||
$localonly++;
|
||||
++$localonly;
|
||||
}
|
||||
if ($DXProt::badspotter->in($spotternoid)) {
|
||||
LogDbg('DXCommand', "badspotter $spotternoid as $spotter ($oline) from $addr");
|
||||
$localonly++;
|
||||
LogDbg('DXCommand', "badspotter $spotternoid as $spotter ($oline) from $ipaddr");
|
||||
++$localonly;
|
||||
}
|
||||
if ($ipaddr && DXCIDR::find($ipaddr)) {
|
||||
LogDbg('DXCommand', "Bad IP address $ipaddr $spotternoid as $spotter ($oline)");
|
||||
++$localonly;
|
||||
}
|
||||
|
||||
dbg "spotter $spotternoid/$callnoid\n";
|
||||
#dbg "spotter $spotternoid/$callnoid\";
|
||||
|
||||
if (($spotted =~ /$spotternoid/ || $spotted =~ /$callnoid/) && $freq < $Spot::minselfspotqrg) {
|
||||
LogDbg('DXCommand', "$spotternoid/$callnoid trying to self spot below ${Spot::minselfspotqrg}KHz ($oline) from $addr, not passed on to cluster");
|
||||
|
24
cmd/set/badip.pl
Normal file
24
cmd/set/badip.pl
Normal file
@ -0,0 +1,24 @@
|
||||
#
|
||||
# set list of bad dx nodes
|
||||
#
|
||||
# Copyright (c) 2021 - Dirk Koopman G1TLH
|
||||
#
|
||||
#
|
||||
#
|
||||
my ($self, $line) = @_;
|
||||
return (1, $self->msg('e5')) if $self->remotecmd;
|
||||
# are we permitted?
|
||||
return (1, $self->msg('e5')) if $self->priv < 6;
|
||||
my @out;
|
||||
my @added;
|
||||
my @in = split /\s+/, $line;
|
||||
return (1, "set/badip: need IP, IP-IP or IP/24") unless @in;
|
||||
for (@in) {
|
||||
eval{ DXCIDR::add($_); };
|
||||
return (1, "set/badip: $_ $@") if $@;
|
||||
push @added, $_;
|
||||
}
|
||||
my $count = @added;
|
||||
my $list = join ' ', @in;
|
||||
push @out, "set/badip: added $count entries: $list";
|
||||
return (1, @out);
|
28
cmd/show/badip.pl
Normal file
28
cmd/show/badip.pl
Normal file
@ -0,0 +1,28 @@
|
||||
#
|
||||
# set list of bad dx nodes
|
||||
#
|
||||
# Copyright (c) 2021 - Dirk Koopman G1TLH
|
||||
#
|
||||
#
|
||||
#
|
||||
my ($self, $line) = @_;
|
||||
return (1, $self->msg('e5')) if $self->remotecmd;
|
||||
# are we permitted?
|
||||
return (1, $self->msg('e5')) if $self->priv < 6;
|
||||
my @out;
|
||||
my @added;
|
||||
my @in = split /\s+/, $line;
|
||||
my @list= DXCIDR::list();
|
||||
foreach my $list (@list) {
|
||||
if (@in) {
|
||||
for (@in) {
|
||||
if ($list =~ /$_/i) {
|
||||
push @out, $list;
|
||||
last;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
push @out, $list;
|
||||
}
|
||||
}
|
||||
return (1, @out);
|
@ -62,19 +62,25 @@ foreach $call (sort @call) {
|
||||
if ($call eq $main::mycall) {
|
||||
$sort = "Spider";
|
||||
$ver = $main::version;
|
||||
$build = $main::build;
|
||||
} else {
|
||||
$ver = $clref->version if $clref && $clref->version;
|
||||
$ver = $uref->version if !$ver && $uref->version;
|
||||
$sort = "CCClus" if $ver >= 1000 && $ver < 4000 && $sort eq "Spider";
|
||||
$sort = "CCClus" if $ver && $ver >= 1000 && $ver < 4000 && $sort eq "Spider";
|
||||
}
|
||||
|
||||
if ($uref->is_spider || ($clref && $clref->do_pc9x)) {
|
||||
$ver /= 100 if $ver > 5400;
|
||||
$ver -= 53 if $ver > 54;
|
||||
if ($ver && $ver > 5400) {
|
||||
$ver =~ s/^5\d/5./;
|
||||
}
|
||||
if ($clref && $clref->build) {
|
||||
$build = "build: " . $clref->build
|
||||
$build = $clref->build
|
||||
} elsif ($uref->build) {
|
||||
$build = "build: " . $uref->build;
|
||||
$build = $uref->build;
|
||||
}
|
||||
if ($build) {
|
||||
$build =~ s/^0\.//;
|
||||
$build = "build: $build";
|
||||
}
|
||||
push @out, $self->msg('snode2', $pcall, $sort, "$ver $build");
|
||||
} else {
|
||||
|
156
perl/DXCIDR.pm
Normal file
156
perl/DXCIDR.pm
Normal file
@ -0,0 +1,156 @@
|
||||
#
|
||||
# IP Address block list / checker
|
||||
#
|
||||
# This is a DXSpider compatible, optional skin over Net::CIDR::Lite
|
||||
# If Net::CIDR::Lite is not present, then a find will always returns 0
|
||||
#
|
||||
|
||||
package DXCIDR;
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
use 5.16.1;
|
||||
use DXVars;
|
||||
use DXDebug;
|
||||
use DXUtil;
|
||||
use DXLog;
|
||||
use IO::File;
|
||||
use File::Copy;
|
||||
|
||||
our $active = 0;
|
||||
our $badipfn = "badip";
|
||||
my $ipv4;
|
||||
my $ipv6;
|
||||
my $count4 = 0;
|
||||
my $count6 = 0;
|
||||
|
||||
# load the badip file
|
||||
sub load
|
||||
{
|
||||
if ($active) {
|
||||
$count4 = _get($ipv4, 4);
|
||||
$count6 = _get($ipv6, 6);
|
||||
}
|
||||
LogDbg('DXProt', "DXCIDR: loaded $count4 IPV4 addresses and $count6 IPV6 addresses");
|
||||
return $count4 + $count6;
|
||||
}
|
||||
|
||||
sub _fn
|
||||
{
|
||||
return localdata($badipfn) . "$_[0]";
|
||||
}
|
||||
|
||||
sub _get
|
||||
{
|
||||
my $list = shift;
|
||||
my $sort = shift;
|
||||
my $fn = _fn($sort);
|
||||
my $fh = IO::File->new($fn);
|
||||
my $count = 0;
|
||||
|
||||
if ($fh) {
|
||||
while (<$fh>) {
|
||||
chomp;
|
||||
next if /^\s*\#/;
|
||||
$list->add($_);
|
||||
++$count;
|
||||
}
|
||||
$fh->close;
|
||||
$list->clean if $count;
|
||||
} elsif (-r $fn) {
|
||||
LogDbg('err', "DXCIDR: $fn not found ($!)");
|
||||
}
|
||||
return $count;
|
||||
}
|
||||
|
||||
sub _put
|
||||
{
|
||||
my $list = shift;
|
||||
my $sort = shift;
|
||||
my $fn = _fn($sort);
|
||||
my $r = rand;
|
||||
my $fh = IO::File->new (">$fn.$r");
|
||||
if ($fh) {
|
||||
for ($list->list) {
|
||||
$fh->print("$_\n");
|
||||
}
|
||||
move "$fn.$r", $fn;
|
||||
} else {
|
||||
LogDbg('err', "DXCIDR: cannot write $fn.$r $!");
|
||||
}
|
||||
}
|
||||
|
||||
sub add
|
||||
{
|
||||
for (@_) {
|
||||
# protect against stupid or malicious
|
||||
next if /^127\./;
|
||||
next if /^::1$/;
|
||||
if (/\./) {
|
||||
$ipv4->add($_);
|
||||
++$count4;
|
||||
LogDbg('DXProt', "DXCIDR: Added IPV4 $_ address");
|
||||
} else {
|
||||
$ipv6->add($_);
|
||||
++$count6;
|
||||
LogDbg('DXProt', "DXCIDR: Added IPV6 $_ address");
|
||||
}
|
||||
}
|
||||
if ($ipv4 && $count4) {
|
||||
$ipv4->prep_find;
|
||||
_put($ipv4, 4);
|
||||
}
|
||||
if ($ipv6 && $count6) {
|
||||
$ipv6->prep_find;
|
||||
_put($ipv6, 6);
|
||||
}
|
||||
}
|
||||
|
||||
sub save
|
||||
{
|
||||
return 0 unless $active;
|
||||
my $list = $ipv4->list;
|
||||
_put($list, 4) if $list;
|
||||
$list = $ipv6->list;
|
||||
_put($list, 6) if $list;
|
||||
}
|
||||
|
||||
sub list
|
||||
{
|
||||
my @out;
|
||||
push @out, $ipv4->list;
|
||||
push @out, $ipv6->list;
|
||||
return (1, sort @out);
|
||||
}
|
||||
|
||||
sub find
|
||||
{
|
||||
return 0 unless $active;
|
||||
return 0 unless $_[0];
|
||||
|
||||
if ($_[0] =~ /\./) {
|
||||
return $ipv4->find($_[0]) if $count4;
|
||||
}
|
||||
return $ipv6->find($_[0]) if $count6;
|
||||
}
|
||||
|
||||
sub init
|
||||
{
|
||||
eval { require Net::CIDR::Lite };
|
||||
if ($@) {
|
||||
LogDbg('DXProt', "DXCIDR: load (cpanm) the perl module Net::CIDR::Lite to check for bad IP addresses (or CIDR ranges)");
|
||||
return;
|
||||
}
|
||||
|
||||
import Net::CIDR::Lite;
|
||||
|
||||
$ipv4 = Net::CIDR::Lite->new;
|
||||
$ipv6 = Net::CIDR::Lite->new;
|
||||
|
||||
load();
|
||||
$active = 1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
1;
|
@ -41,95 +41,96 @@ use vars qw(%channels %valid @ISA $count $maxerrors);
|
||||
$count = 0;
|
||||
|
||||
%valid = (
|
||||
call => '0,Callsign',
|
||||
conn => '9,Msg Conn ref',
|
||||
user => '9,DXUser ref',
|
||||
startt => '0,Start Time,atime',
|
||||
t => '9,Time,atime',
|
||||
pc50_t => '5,Last PC50 Time,atime',
|
||||
priv => '9,Privilege',
|
||||
state => '0,Current State',
|
||||
oldstate => '5,Last State',
|
||||
list => '9,Dep Chan List',
|
||||
name => '0,User Name',
|
||||
consort => '5,Connection Type',
|
||||
'sort' => '5,Type of Channel',
|
||||
wwv => '0,Want WWV,yesno',
|
||||
wcy => '0,Want WCY,yesno',
|
||||
wx => '0,Want WX,yesno',
|
||||
talk => '0,Want Talk,yesno',
|
||||
ann => '0,Want Announce,yesno',
|
||||
here => '0,Here?,yesno',
|
||||
conf => '0,In Conference?,yesno',
|
||||
dx => '0,DX Spots,yesno',
|
||||
redirect => '0,Redirect messages to',
|
||||
lang => '0,Language',
|
||||
func => '5,Function',
|
||||
loc => '9,Local Vars', # used by func to store local variables in
|
||||
beep => '0,Want Beeps,yesno',
|
||||
lastread => '5,Last Msg Read',
|
||||
outbound => '5,outbound?,yesno',
|
||||
remotecmd => '9,doing rcmd,yesno',
|
||||
pagelth => '0,Page Length',
|
||||
pagedata => '9,Page Data Store',
|
||||
group => '0,Access Group,parray', # used to create a group of users/nodes for some purpose or other
|
||||
isolate => '5,Isolate network,yesno',
|
||||
delayed => '5,Delayed messages,parray',
|
||||
annfilter => '5,Ann Filt-out',
|
||||
wwvfilter => '5,WWV Filt-out',
|
||||
wcyfilter => '5,WCY Filt-out',
|
||||
spotsfilter => '5,Spot Filt-out',
|
||||
routefilter => '5,Route Filt-out',
|
||||
rbnfilter => '5,RBN Filt-out',
|
||||
pc92filter => '5,PC92 Route Filt-out',
|
||||
inannfilter => '5,Ann Filt-inp',
|
||||
inwwvfilter => '5,WWV Filt-inp',
|
||||
inwcyfilter => '5,WCY Filt-inp',
|
||||
inspotsfilter => '5,Spot Filt-inp',
|
||||
inroutefilter => '5,Route Filt-inp',
|
||||
inrbnfilter => '5,RBN Filt-inp',
|
||||
inpc92filter => '5,PC92 Route Filt-inp',
|
||||
passwd => '9,Passwd List,yesno',
|
||||
pingint => '5,Ping Interval ',
|
||||
nopings => '5,Ping Obs Count',
|
||||
lastping => '5,Ping last sent,atime',
|
||||
pingtime => '5,Ping totaltime,parray',
|
||||
pingave => '0,Ping ave time',
|
||||
logininfo => '9,Login info req,yesno',
|
||||
talklist => '0,Talk List,parray',
|
||||
cluster => '5,Cluster data',
|
||||
isbasic => '9,Internal Connection',
|
||||
errors => '9,Errors',
|
||||
route => '9,Route Data',
|
||||
dxcc => '0,Country Code',
|
||||
itu => '0,ITU Zone',
|
||||
cq => '0,CQ Zone',
|
||||
enhanced => '5,Enhanced Client,yesno',
|
||||
gtk => '5,Using GTK,yesno',
|
||||
senddbg => '8,Sending Debug,yesno',
|
||||
width => '0,Column Width',
|
||||
disconnecting => '9,Disconnecting,yesno',
|
||||
ann_talk => '0,Suppress Talk Anns,yesno',
|
||||
metric => '1,Route metric',
|
||||
annfilter => '5,Ann Filt-out',
|
||||
badcount => '1,Bad Word Count',
|
||||
edit => '7,Edit Function',
|
||||
registered => '9,Registered?,yesno',
|
||||
prompt => '0,Required Prompt',
|
||||
version => '1,Node Version',
|
||||
badip => '9,BAD IP address',
|
||||
beep => '0,Want Beeps,yesno',
|
||||
build => '1,Node Build',
|
||||
verified => '9,Verified?,yesno',
|
||||
newroute => '1,New Style Routing,yesno',
|
||||
ve7cc => '0,VE7CC program special,yesno',
|
||||
lastmsgpoll => '0,Last Msg Poll,atime',
|
||||
inscript => '9,In a script,yesno',
|
||||
handle_xml => '9,Handles XML,yesno',
|
||||
call => '0,Callsign',
|
||||
cluster => '5,Cluster data',
|
||||
conf => '0,In Conference?,yesno',
|
||||
conn => '9,Msg Conn ref',
|
||||
consort => '5,Connection Type',
|
||||
cq => '0,CQ Zone',
|
||||
delayed => '5,Delayed messages,parray',
|
||||
disconnecting => '9,Disconnecting,yesno',
|
||||
do_pc9x => '9,Handles PC9x,yesno',
|
||||
inqueue => '9,Input Queue,parray',
|
||||
next_pc92_update => '9,Next PC92 Update,atime',
|
||||
next_pc92_keepalive => '9,Next PC92 KeepAlive,atime',
|
||||
dx => '0,DX Spots,yesno',
|
||||
dxcc => '0,Country Code',
|
||||
edit => '7,Edit Function',
|
||||
enhanced => '5,Enhanced Client,yesno',
|
||||
errors => '9,Errors',
|
||||
func => '5,Function',
|
||||
group => '0,Access Group,parray', # used to create a group of users/nodes for some purpose or other
|
||||
gtk => '5,Using GTK,yesno',
|
||||
handle_xml => '9,Handles XML,yesno',
|
||||
here => '0,Here?,yesno',
|
||||
hostname => '0,Hostname',
|
||||
inannfilter => '5,Ann Filt-inp',
|
||||
inpc92filter => '5,PC92 Route Filt-inp',
|
||||
inqueue => '9,Input Queue,parray',
|
||||
inrbnfilter => '5,RBN Filt-inp',
|
||||
inroutefilter => '5,Route Filt-inp',
|
||||
inscript => '9,In a script,yesno',
|
||||
inspotsfilter => '5,Spot Filt-inp',
|
||||
inwcyfilter => '5,WCY Filt-inp',
|
||||
inwwvfilter => '5,WWV Filt-inp',
|
||||
isbasic => '9,Internal Connection',
|
||||
isolate => '5,Isolate network,yesno',
|
||||
isslugged => '9,Still Slugged,yesno',
|
||||
itu => '0,ITU Zone',
|
||||
lang => '0,Language',
|
||||
lastmsgpoll => '0,Last Msg Poll,atime',
|
||||
lastping => '5,Ping last sent,atime',
|
||||
lastread => '5,Last Msg Read',
|
||||
list => '9,Dep Chan List',
|
||||
loc => '9,Local Vars', # used by func to store local variables in
|
||||
logininfo => '9,Login info req,yesno',
|
||||
metric => '1,Route metric',
|
||||
name => '0,User Name',
|
||||
newroute => '1,New Style Routing,yesno',
|
||||
next_pc92_keepalive => '9,Next PC92 KeepAlive,atime',
|
||||
next_pc92_update => '9,Next PC92 Update,atime',
|
||||
nopings => '5,Ping Obs Count',
|
||||
oldstate => '5,Last State',
|
||||
outbound => '5,outbound?,yesno',
|
||||
pagedata => '9,Page Data Store',
|
||||
pagelth => '0,Page Length',
|
||||
passwd => '9,Passwd List,yesno',
|
||||
pc50_t => '5,Last PC50 Time,atime',
|
||||
pc92filter => '5,PC92 Route Filt-out',
|
||||
pingave => '0,Ping ave time',
|
||||
pingint => '5,Ping Interval ',
|
||||
pingtime => '5,Ping totaltime,parray',
|
||||
priv => '9,Privilege',
|
||||
prompt => '0,Required Prompt',
|
||||
rbnfilter => '5,RBN Filt-out',
|
||||
redirect => '0,Redirect messages to',
|
||||
registered => '9,Registered?,yesno',
|
||||
remotecmd => '9,doing rcmd,yesno',
|
||||
route => '9,Route Data',
|
||||
routefilter => '5,Route Filt-out',
|
||||
senddbg => '8,Sending Debug,yesno',
|
||||
sluggedpcs => '9,Slugged PCxx Queue,parray',
|
||||
spotsfilter => '5,Spot Filt-out',
|
||||
startt => '0,Start Time,atime',
|
||||
state => '0,Current State',
|
||||
t => '9,Time,atime',
|
||||
talk => '0,Want Talk,yesno',
|
||||
talklist => '0,Talk List,parray',
|
||||
user => '9,DXUser ref',
|
||||
ve7cc => '0,VE7CC program special,yesno',
|
||||
verified => '9,Verified?,yesno',
|
||||
version => '1,Node Version',
|
||||
wcy => '0,Want WCY,yesno',
|
||||
wcyfilter => '5,WCY Filt-out',
|
||||
width => '0,Column Width',
|
||||
wwv => '0,Want WWV,yesno',
|
||||
wwvfilter => '5,WWV Filt-out',
|
||||
wx => '0,Want WX,yesno',
|
||||
);
|
||||
|
||||
$maxerrors = 20; # the maximum number of concurrent errors allowed before disconnection
|
||||
|
@ -39,6 +39,7 @@ use DB_File;
|
||||
use VE7CC;
|
||||
use DXXml;
|
||||
use AsyncMsg;
|
||||
use DXCIDR;
|
||||
|
||||
use strict;
|
||||
use vars qw(%Cache %cmd_cache $errstr %aliases $scriptbase %nothereslug
|
||||
@ -194,6 +195,11 @@ sub start
|
||||
|
||||
$self->tell_login('loginu');
|
||||
$self->tell_buddies('loginb');
|
||||
|
||||
# is this a bad ip address?
|
||||
if (is_ipaddr($self->{hostname})) {
|
||||
$self->{badip} = DXCIDR->find($self->{hostname});
|
||||
}
|
||||
|
||||
# do we need to send a forward/opernam?
|
||||
my $lastoper = $user->lastoper || 0;
|
||||
|
@ -33,6 +33,7 @@ use Route;
|
||||
use Route::Node;
|
||||
use Script;
|
||||
use DXProtHandle;
|
||||
use DXCIDR;
|
||||
|
||||
use strict;
|
||||
|
||||
|
@ -32,6 +32,7 @@ use DXHash;
|
||||
use Route;
|
||||
use Route::Node;
|
||||
use Script;
|
||||
use DXCIDR;
|
||||
|
||||
use strict;
|
||||
use warnings qw(all);
|
||||
@ -185,6 +186,16 @@ sub handle_11
|
||||
return;
|
||||
}
|
||||
|
||||
# check IP addresses
|
||||
if ($pc->[8] && is_ipaddr($pc->[8])) {
|
||||
my $ip = $pc->[8];
|
||||
$ip =~ s/,/:/g;
|
||||
$ip =~ s/^::ffff://;
|
||||
if (DXCIDR::find($ip)) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
# convert the date to a unix date
|
||||
my $d = cltounix($pc->[3], $pc->[4]);
|
||||
# bang out (and don't pass on) if date is invalid or the spot is too old (or too young)
|
||||
@ -1647,12 +1658,12 @@ sub _add_thingy
|
||||
@rout = $parent->add($call, $version, Route::here($here), $ip);
|
||||
$r = Route::Node::get($call);
|
||||
$r->PC92C_dxchan($dxchan->call, $hops) if $r;
|
||||
if ($version && $version =~ /^\d+$/) {
|
||||
if ($version && is_numeric($version) && !$r->K && !$user->K) {
|
||||
my $old = $user->sort;
|
||||
if ($user->is_ak1a && (($version >= 5455 && $build > 0) || ($version >= 3000 && $version <= 3500)) ) {
|
||||
$user->sort('S');
|
||||
dbg("PCProt::_add_thingy node $call v: $version b: $build sort ($old) updated to " . $user->sort);
|
||||
} elsif ($user->is_spider && $version =~ /^\d+$/ && ($version < 3000 || ($version > 4000 && $version < 5455))) {
|
||||
} elsif ($user->is_spider && ($version < 3000 || ($version > 4000 && $version < 5455))) {
|
||||
unless ($version == 5000 && $build == 0) {
|
||||
$user->sort('A');
|
||||
$build //= 0;
|
||||
@ -1660,6 +1671,9 @@ sub _add_thingy
|
||||
}
|
||||
}
|
||||
}
|
||||
$r->version($user->version) if $user->version;
|
||||
$r->build($user->build) if $user->build;
|
||||
$r->K(1) if $user->K;
|
||||
} else {
|
||||
dbg("ROUTE: added user $call to $ncall") if isdbg('routelow');
|
||||
$user = check_add_user($call, 'U', $parent->call);
|
||||
@ -2004,22 +2018,38 @@ sub handle_92
|
||||
my $call = $parent->call;
|
||||
my $version = $ent[4] || 0;
|
||||
my $build = $ent[5] || 0;
|
||||
$build =~ s/^0\.//;
|
||||
my $oldbuild = $parent->build || 0;
|
||||
my $oldversion = $parent->version || 0;
|
||||
my $user = check_add_user($parent->call, 'S');
|
||||
my $oldsort = $user->sort // '';
|
||||
# if ($version =~ /^\d+$/ && $oldversion =~ /^\d+$/) {
|
||||
if ($oldsort ne 'S' || $oldversion != $version || $build != $oldbuild) {
|
||||
dbg("PCProt PC92 K node $call updated version: $version (was $oldversion) build: $build (was $oldbuild) sort: 'S' (was $oldsort)");
|
||||
$user->sort('S');
|
||||
|
||||
dbg("PCProt PC92 K v: $version ov: $oldversion b: $build ob: $oldbuild pk: " . ($parent->K || '0') . " uk: " . ($user->K || 0)) if isdbg('pc92k');
|
||||
|
||||
if (is_numeric($version) || is_numeric($build)) {
|
||||
my $changed = 0;
|
||||
if (($oldversion ne $version || $build ne $oldbuild)) {
|
||||
dbg("PCProt PC92 K node $call updated version: $version (was $oldversion) build: $build (was $oldbuild)");
|
||||
$user->version($parent->version($version));
|
||||
$user->build($parent->build($build));
|
||||
$user->put;
|
||||
++$changed;
|
||||
}
|
||||
# } else {
|
||||
# dbg("DXProt PC92 K version strings new: '$version' old: '$oldversion'");
|
||||
# }
|
||||
dbg("ROUTE: reset obscount on $parent->{call} now " . $parent->obscount) if isdbg('obscount');
|
||||
if ($oldsort ne 'S') {
|
||||
dbg("PCProt PC92 K node $call updated sort: $sort (was $oldsort)");
|
||||
$user->sort('S');
|
||||
++$changed;
|
||||
}
|
||||
unless ($user->K) {
|
||||
dbg("PCProt PC92 K node $call updated - marked as PC92 K user");
|
||||
$user->K(1);
|
||||
++$changed;
|
||||
}
|
||||
$user->put if $changed;
|
||||
$parent->K(1); # mark this as come in on a K
|
||||
} else {
|
||||
dbg("DXProt PC92 K version call $call: invalid version: '$version' or build: '$version', ignored");
|
||||
}
|
||||
dbg("ROUTE: reset obscount on $call now " . $parent->obscount) if isdbg('obscount');
|
||||
}
|
||||
} elsif ($sort eq 'A' || $sort eq 'D' || $sort eq 'C') {
|
||||
|
||||
|
@ -32,65 +32,66 @@ $v3 = 0;
|
||||
|
||||
# hash of valid elements and a simple prompt
|
||||
%valid = (
|
||||
call => '0,Callsign',
|
||||
alias => '0,Real Callsign',
|
||||
name => '0,Name',
|
||||
qth => '0,Home QTH',
|
||||
lat => '0,Latitude,slat',
|
||||
long => '0,Longitude,slong',
|
||||
qra => '0,Locator',
|
||||
email => '0,E-mail Address,parray',
|
||||
priv => '9,Privilege Level',
|
||||
lastin => '0,Last Time in,cldatetime',
|
||||
passwd => '9,Password,yesno',
|
||||
passphrase => '9,Pass Phrase,yesno',
|
||||
addr => '0,Full Address',
|
||||
'sort' => '0,Type of User', # A - ak1a, U - User, S - spider cluster, B - BBS
|
||||
xpert => '0,Expert Status,yesno',
|
||||
bbs => '0,Home BBS',
|
||||
node => '0,Last Node',
|
||||
homenode => '0,Home Node',
|
||||
lockout => '9,Locked out?,yesno', # won't let them in at all
|
||||
dxok => '9,Accept DX Spots?,yesno', # accept his dx spots?
|
||||
addr => '0,Full Address',
|
||||
alias => '0,Real Callsign',
|
||||
annok => '9,Accept Announces?,yesno', # accept his announces?
|
||||
lang => '0,Language',
|
||||
hmsgno => '0,Highest Msgno',
|
||||
group => '0,Group,parray', # used to create a group of users/nodes for some purpose or other
|
||||
bbs => '0,Home BBS',
|
||||
believe => '1,Believable nodes,parray',
|
||||
buddies => '0,Buddies,parray',
|
||||
build => '1,Build',
|
||||
call => '0,Callsign',
|
||||
dxok => '9,Accept DX Spots?,yesno', # accept his dx spots?
|
||||
email => '0,E-mail Address,parray',
|
||||
group => '0,Group,parray', # used to create a group of users/nodes for some purpose or other
|
||||
hmsgno => '0,Highest Msgno',
|
||||
homenode => '0,Home Node',
|
||||
isolate => '9,Isolate network,yesno',
|
||||
wantbeep => '0,Req Beep,yesno',
|
||||
wantann => '0,Req Announce,yesno',
|
||||
wantwwv => '0,Req WWV,yesno',
|
||||
wantwcy => '0,Req WCY,yesno',
|
||||
wantecho => '0,Req Echo,yesno',
|
||||
wanttalk => '0,Req Talk,yesno',
|
||||
wantwx => '0,Req WX,yesno',
|
||||
wantdx => '0,Req DX Spots,yesno',
|
||||
wantemail => '0,Req Msgs as Email,yesno',
|
||||
pagelth => '0,Current Pagelth',
|
||||
pingint => '9,Node Ping interval',
|
||||
K => '9,Seen on PC92 K,yesno',
|
||||
lang => '0,Language',
|
||||
lastin => '0,Last Time in,cldatetime',
|
||||
lastoper => '9,Last for/oper,cldatetime',
|
||||
lastping => '1,Last Ping at,ptimelist',
|
||||
lat => '0,Latitude,slat',
|
||||
lockout => '9,Locked out?,yesno', # won't let them in at all
|
||||
long => '0,Longitude,slong',
|
||||
maxconnect => '1,Max Connections',
|
||||
name => '0,Name',
|
||||
node => '0,Last Node',
|
||||
nopings => '9,Ping Obs Count',
|
||||
wantlogininfo => '0,Login Info Req,yesno',
|
||||
wantgrid => '0,Show DX Grid,yesno',
|
||||
nothere => '0,Not Here Text',
|
||||
pagelth => '0,Current Pagelth',
|
||||
passphrase => '9,Pass Phrase,yesno',
|
||||
passwd => '9,Password,yesno',
|
||||
pingint => '9,Node Ping interval',
|
||||
priv => '9,Privilege Level',
|
||||
prompt => '0,Required Prompt',
|
||||
qra => '0,Locator',
|
||||
qth => '0,Home QTH',
|
||||
registered => '9,Registered?,yesno',
|
||||
version => '1,Version',
|
||||
wantann => '0,Req Announce,yesno',
|
||||
wantann_talk => '0,Talklike Anns,yesno',
|
||||
wantpc16 => '9,Want Users from node,yesno',
|
||||
wantsendpc16 => '9,Send PC16,yesno',
|
||||
wantroutepc19 => '9,Route PC19,yesno',
|
||||
wantusstate => '0,Show US State,yesno',
|
||||
wantbeep => '0,Req Beep,yesno',
|
||||
wantdx => '0,Req DX Spots,yesno',
|
||||
wantdxcq => '0,Show CQ Zone,yesno',
|
||||
wantdxitu => '0,Show ITU Zone,yesno',
|
||||
wantecho => '0,Req Echo,yesno',
|
||||
wantemail => '0,Req Msgs as Email,yesno',
|
||||
wantgtk => '0,Want GTK interface,yesno',
|
||||
wantlogininfo => '0,Login Info Req,yesno',
|
||||
wantpc16 => '9,Want Users from node,yesno',
|
||||
wantpc9x => '0,Want PC9X interface,yesno',
|
||||
lastoper => '9,Last for/oper,cldatetime',
|
||||
nothere => '0,Not Here Text',
|
||||
registered => '9,Registered?,yesno',
|
||||
prompt => '0,Required Prompt',
|
||||
version => '1,Version',
|
||||
build => '1,Build',
|
||||
believe => '1,Believable nodes,parray',
|
||||
lastping => '1,Last Ping at,ptimelist',
|
||||
maxconnect => '1,Max Connections',
|
||||
wantroutepc19 => '9,Route PC19,yesno',
|
||||
wantsendpc16 => '9,Send PC16,yesno',
|
||||
wanttalk => '0,Req Talk,yesno',
|
||||
wantusstate => '0,Show US State,yesno',
|
||||
wantwcy => '0,Req WCY,yesno',
|
||||
wantwwv => '0,Req WWV,yesno',
|
||||
wantwx => '0,Req WX,yesno',
|
||||
width => '0,Preferred Width',
|
||||
xpert => '0,Expert Status,yesno',
|
||||
wantgrid => '0,Show DX Grid,yesno',
|
||||
);
|
||||
|
||||
#no strict;
|
||||
|
@ -29,7 +29,7 @@ require Exporter;
|
||||
is_qra is_freq is_digits is_pctext is_pcflag insertitem deleteitem
|
||||
is_prefix dd is_ipaddr $pi $d2r $r2d localdata localdata_mv
|
||||
diffms _diffms _diffus difft parraydifft is_ztime basecall
|
||||
normalise_call
|
||||
normalise_call is_numeric
|
||||
);
|
||||
|
||||
|
||||
@ -614,3 +614,8 @@ sub normalise_call
|
||||
$ncall .= "-$ssid" if $ssid;
|
||||
return $ncall;
|
||||
}
|
||||
|
||||
sub is_numeric
|
||||
{
|
||||
return $_[0] =~ /^\d+$/;
|
||||
}
|
||||
|
4448
perl/Messages
4448
perl/Messages
File diff suppressed because it is too large
Load Diff
@ -19,6 +19,7 @@ use vars qw(%list %valid @ISA $max $filterdef $obscount);
|
||||
@ISA = qw(Route);
|
||||
|
||||
%valid = (
|
||||
K => '9,Seen on PC92K,yesno',
|
||||
nodes => '0,Nodes,parray',
|
||||
users => '0,Users,parray',
|
||||
usercount => '0,User Count',
|
||||
|
1
perl/SysVar.pm
Normal file
1
perl/SysVar.pm
Normal file
@ -0,0 +1 @@
|
||||
1;
|
@ -121,6 +121,7 @@ use DXXml;
|
||||
use DXSql;
|
||||
use IsoTime;
|
||||
use BPQMsg;
|
||||
use DXCIDR;
|
||||
|
||||
use Data::Dumper;
|
||||
use IO::File;
|
||||
@ -477,6 +478,9 @@ DXUser->init($userfn, 1);
|
||||
}
|
||||
}
|
||||
|
||||
# get any bad IPs
|
||||
DXCIDR::init();
|
||||
|
||||
# start listening for incoming messages/connects
|
||||
dbg("starting listeners ...");
|
||||
my $conn = IntMsg->new_server($clusteraddr, $clusterport, \&login);
|
||||
|
@ -116,7 +116,7 @@ sub do_initscr
|
||||
$mycallcolor = COLOR_PAIR(1) unless $mycallcolor;
|
||||
}
|
||||
|
||||
sub do_resize
|
||||
sub doresize
|
||||
{
|
||||
endwin() if $scr;
|
||||
initscr();
|
||||
@ -527,7 +527,7 @@ unless ($DB::VERSION) {
|
||||
$SIG{'HUP'} = \&sig_term;
|
||||
|
||||
# start up
|
||||
do_resize();
|
||||
doresize();
|
||||
|
||||
$SIG{__DIE__} = \&sig_term;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user