You are here

function _httpbl_reverse_ip in http:BL 6

Same name and namespace in other branches
  1. 6.2 httpbl.module \_httpbl_reverse_ip()
  2. 7 httpbl.module \_httpbl_reverse_ip()

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 486
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];
}