diff --git a/pandora_console/include/functions.php b/pandora_console/include/functions.php index 0b9f71221b..c928bcc6ef 100644 --- a/pandora_console/include/functions.php +++ b/pandora_console/include/functions.php @@ -3853,9 +3853,10 @@ function pandora_xhprof_display_result($key='', $method='link') /** * From a network with a mask remove the smallest ip and the highest * - * @param string address to identify the network. - * @param string mask to identify the mask network - * @return array or false with smallest ip and highest ip + * @param string $address Identify the network. + * @param string $mask Identify the mask network. + * + * @return array or false with smallest ip and highest ip. */ function range_ips_for_network($address, $mask) { @@ -3863,15 +3864,15 @@ function range_ips_for_network($address, $mask) return false; } - // convert ip addresses to long form + // Convert ip addresses to long form. $address_long = ip2long($address); $mask_long = ip2long($mask); - // caculate first usable address + // Calculate first usable address. $ip_host_first = ((~$mask_long) & $address_long); - $ip_first = (($address_long ^ $ip_host_first) + 1); + $ip_first = (($address_long ^ $ip_host_first)); - // caculate last usable address + // Calculate last usable address. $ip_broadcast_invert = ~$mask_long; $ip_last = (($address_long | $ip_broadcast_invert) - 1); @@ -3887,9 +3888,10 @@ function range_ips_for_network($address, $mask) /** * from two ips find out if there is such an ip * - * @param string ip ip wont validate - * @param string ip_lower - * @param string ip_upper + * @param string ip ip wont validate + * @param string ip_lower + * @param string ip_upper + * * @return boolean true or false if the ip is between the two ips */ function is_in_network($ip, $ip_lower, $ip_upper)