Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagephp
titleResolving in it's simplest form
require_once(__DIR__ . "/tornevall_dnsbl.php");
$dnsbl = new \TorneLIB\TorneLIB_DNSBL();
if ($dnsbl->isListed($testaddr)) {
    /* Actions to take against this host */
}

Other methods

MethodParametersTypeResult
isListed()
ipAddressboolThe example above
resolveBlacklist()
ipAddress (v4/v6)
getListedTypes (default=false) 
array

An array with strings defined in TORNEVALL_DNSBL_BITS.
The constants are listed below.

BIT_REPORTED = 1
BIT_CONFIRMED = 2
BIT_FRAUDBL = 4
BIT_EMPTY = 8
BIT_SPAM = 16
BIT_ANONYMOUS = 32
BIT_ABUSE = 64
BIT_DIFFERENTSTATE = 128

When getListedTypes are set to true, this function is returning data from TORNEVALL_DNSBL_BITS::getBitArray() 

getBitArray()
bitValue (integer)array 
getBlVersion()
blZonestringIf no zone are given the default value from the class TORNEVALL_DNSBL_ZONES is set to dnsbl.tornevall.org.
As described above, which DNSBL version is active, this function returns the version id of the current release. 
isBit()
bitType, bitValuebool

The TORNEVALL_DNSBL_BITS-class also have another method callable from public called isBit().
Let's say that you have the bitmask value 80, which represents the two bits BIT_ABUSE (64) and BIT_SPAM (16), you can ask this function if they are present. 

Code Block
languagephp
titleisBit()-method
$bitValue = 80;
$BitClass = new \TorneLIB\TORNEVALL_DNSBL_BITS();
if ($BitClass->isBit(self::BIT_SPAM, $bitValue)) { /* Do something here */ }
if ($BitClass->isBit(self::BIT_ABUSE, $bitValue)) { /* Do something here */ }

This method is calling isBit() in the TORNEVALL_DNSBL_BITS-class.

What is happening in this component?

JIRA
serverTornevall Networks
columnssummary,type,created,updated,status,resolution
maximumIssues20
jqlQuerycomponent = PHPCli- TorneLIB.PHP_DNSBL ORDER BY status ASC, resolution DESC, "Internal priority", priority DESC, updated DESC
serverIdef1f2374-e58a-319f-9d38-10348dbac859