You are here

function httpbl_reverse_ip in http:BL 5

Reverse IP octets

Parameters

string $ip:

Return value

string

1 call to httpbl_reverse_ip()
httpbl_dnslookup in ./httpbl.module
Do http:BL DNS lookup

File

./httpbl.module, line 475
Implementation of http:BL for Drupal. It provides IP-based blacklisting through http:BL and allows linking to a honeypot.

Code

function httpbl_reverse_ip($ip) {
  if (!is_numeric(str_replace('.', '', $ip))) {
    return NULL;
  }
  $ip = explode('.', $ip);
  if (count($ip) != 4) {
    return NULL;
  }
  return $ip[3] . '.' . $ip[2] . '.' . $ip[1] . '.' . $ip[0];
}