mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Updates
This commit is contained in:
@@ -1202,8 +1202,7 @@ function first_oid_match($device, $list) {
|
||||
}
|
||||
}
|
||||
|
||||
function ip_to_hex($ip) {
|
||||
|
||||
function ip_to_dec($ip) {
|
||||
$return = '';
|
||||
if (strstr($ip, ":")) {
|
||||
$ipv6 = explode(':', $ip);
|
||||
@@ -1216,3 +1215,19 @@ function ip_to_hex($ip) {
|
||||
}
|
||||
return $return;
|
||||
}
|
||||
|
||||
function hex_to_ip($hex) {
|
||||
$return = "";
|
||||
if (filter_var($hex, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4) === FALSE && filter_var($hex, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6) === FALSE) {
|
||||
$hex_exp = explode(' ', $hex);
|
||||
foreach ($hex_exp as $item) {
|
||||
if (!empty($item) && $item != "\"") {
|
||||
$return .= hexdec($item).'.';
|
||||
}
|
||||
}
|
||||
$return = substr($return, 0, -1);
|
||||
} else {
|
||||
$return = $ip;
|
||||
}
|
||||
return $return;
|
||||
}
|
||||
|
Reference in New Issue
Block a user