Net::DNSBL::Utilities - functions for DNSBL daemons
use Net::DNSBL::MultiDaemon qw(
s_response
not_found
write_stats
bystat
statinit
cntinit
list2hash
open_udpNB
DO
list2NetAddr
matchNetAddr
list_countries
setAUTH
setRA
A1271
A1272
A1273
A1274
A1275
A1276
A1277
);
s_response($mp,$resp,$id,$qdcount,$ancount,$nscount,$arcount); not_found($put,$name,$type,$id,$mp,$srp); write_stats($sfile,$cp,$sinit); $rv = bystat($cp); $timestamp = statinit($Sfile,$cp); cntinit($DNSBL,$cp); list2hash(\@list,$cp,$val); $sock = open_udpNB(); $rv = DO($file) $rv=list2NetAddr(\@inlist,\@NAobject); $rv = matchNetAddr($ip,\@NAobject); ($countries,$code3s,$names) = list_countries; setAUTH(true/false); setRA(true/false); $netaddr = A1271; $netaddr = A1272; $netaddr = A1273; $netaddr = A1274; $netaddr = A1275; $netaddr = A1276; $netaddr = A1277;
Net::DNSBL::Utilities contains functions used to build DNSBL emulator daemons.
input: msg pointer,
id of question,
qd, an, ns, ar counts
returns: nada
input: put,
name,
type,
id,
message buffer pointer,
SOA record pointer
returns: nothing
input: statistics file path,
pointer to count hash,
initial timestamp line text
returns: nothing
input: $a,$b sort values
pointer to count hash
returns: sort decision value
input: statistics file path,
pointer to count hash
returns: timestamp line for file
or undef on failure
For compatibility with other applications, LABEL names other than the DNSBL's must NOT contain '.' Only the keys in the DNSBL hash that contain '.'s are added to the count hash.
The count hash is first emptied if it is not null to begin with.
input: pointer to DNSBL hash,
pointer to counts hash
returns: nothing
For compatibility with other applications, the labels in ``list'' must not contain the character '.'
input: pointer to list of labels,
pointer to counts hash,
value [optional]
returns: nothing
input: file/path/name
returns: last value in file
or undef on error
prints warning
input: none
returns: pointer to socket object
or undef on failure
input: array reference pointer
to a list of addresses
i.e. 11.22.33.44
11.22.33.0/24
11.22.33.0/255.255.255.0
11.22.33.20-11.22.33.46
11.22.33.20 - 11.22.33.46
output: Number of objects created
or undef on error
The NAobject array is filled with NetAddr::IP::Lite object references.
input: dot quad IP address,
reference to NetAddr objects
output: true if match else false
input: none
returns: \@countries,\@code3s,\@names
blessed into callers namespace
NOTE: this process is very inefficient and should not be called in a repetitive fashion.
If Geo::IP::PurePerl is not installed, the function returns and empty array and sets $@;
input: true/false returns: nothing
input: true/false returns: nothing
Net::DNS::Codes
Net::DNS::ToolKit
s_response
not_found
write_stats
bystat
statinit
cntinit
list2hash
open_udpNB
DO
list2NetAddr
matchNetAddr
list_countries
setAUTH
setRA
A1271
A1272
A1273
A1274
A1275
A1276
A1277
Michael Robinton, michael@bizsystems.com
Copyright 2003 - 2007, Michael Robinton & BizSystems This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
the Net::DNS::Codes manpage, the Net::DNS::ToolKit manpage, the Mail::SpamCannibal manpage