function _httpbl_reverse_ip in http:BL 7
Same name and namespace in other branches
- 6.2 httpbl.module \_httpbl_reverse_ip()
- 6 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 424 - 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];
}