protected function parseRangeUsingCidr($input, &$range)
{
$input = explode('/', $input);
$this->fillAddress($input[0], '0');
$range['min'] = $input[0];
$isAddressMask = strpos($input[1], '.') !== false;
if ($isAddressMask && $this->verifyAddress($input[1])) {
$range['mask'] = sprintf('%032b', ip2long($input[1]));
return;
}
if ($isAddressMask || $input[1] < 8 || $input[1] > 30) {
throw new ComponentException('Invalid network mask');
}
$range['mask'] = sprintf('%032b', ip2long(long2ip(~(pow(2, 32 - $input[1]) - 1))));
}