RFC: Net::IP::Correct

RFC: Net::IP::Correct

am 29.06.2005 13:28:11 von arcofdescent

Hi,

I would like comments from the community about a module I would
like to implement.

Name: Net::IP::Correct

Description:
Breakdown an incorrect range of IP addresses into
valid IP Ranges

Rationale:

This module will exist as a subclass of Net::IP. It would
basically accept a range of IP address (Net::IP objects), and
if the range is incorrect, it would break it down into
seperate correct IP ranges. Each IP range returned would be a
Net::IP object

I think Net::IP::Correct is a good enough namespace, although
there is also Net::IP::Range::Correct, which is more
meaningful. I'm open to suggestions.

For example: given the range 192.168.1.0 - 192.168.1.5, this
module would break this range down into: -
192.168.1.0/255.255.255.252
192.168.1.4/255.255.255.255
192.168.1.5/255.255.255.255


Thanks.

--
Rohan

Re: RFC: Net::IP::Correct

am 29.06.2005 17:12:24 von mjtg

Rohan R. Almeida wrote:
>
>Description:
> Breakdown an incorrect range of IP addresses into
> valid IP Ranges
>
> For example: given the range 192.168.1.0 - 192.168.1.5, this
> module would break this range down into: -
> 192.168.1.0/255.255.255.252
> 192.168.1.4/255.255.255.255
> 192.168.1.5/255.255.255.255

What is your definition of "correct" here? I would have expected the
result

192.168.1.0/255.255.255.252
192.168.1.4/255.255.255.254


Mike Guy

Re: RFC: Net::IP::Correct

am 29.06.2005 18:55:29 von arcofdescent

M.J.T. Guy wrote:
> What is your definition of "correct" here? I would have expected the
> result
>
> 192.168.1.0/255.255.255.252
> 192.168.1.4/255.255.255.254
>

Yes. That is correct :-)
Unfortunately, I was under the impression that one
couldn't create an IP block consisting of 2 addresses.

But I double-checked, and we can, so a .254 netmask
is possible.

I also propose to name this module Net::IP::Range::Split

Thanks

--
Rohan