IPAddress rocks! Some add on suggestions

56 views
Skip to first unread message

David Dietrich

unread,
Jul 10, 2011, 8:11:22 PM7/10/11
to Ruby IPAddress
Thanks for your work on IPAddress. On occasion, I write scripts to
process objects in firewall databases. In the past I've used Perl, but
now I am using Ruby. In Perl, I've used Net::IP. It has a couple of
things that would fit nicely in IPAddress.

First, arbitrary range objects. Not defined by class or mask, just two
addresses defining an arbitrary range.

Second, a great method called 'overlaps'. Here is description from
Net::IP doc..

"Check if two IP ranges/prefixes overlap each other. The value
returned by the function should be one of: $IP_PARTIAL_OVERLAP (ranges
overlap) $IP_NO_OVERLAP (no overlap) (IP_A_IN_B_OVERLAP (range2
contains range1) $IP_B_IN_A_OVERLAP (range1 contains range2)
$IP_IDENTICAL (ranges are identical) undef (problem)"

Thanks again for IPAddress.

David Dietrich

Marco Ceresa

unread,
Aug 8, 2011, 8:31:52 AM8/8/11
to ruby-ip...@googlegroups.com
On Mon, Jul 11, 2011 at 2:11 AM, David Dietrich <da...@countrysky.net> wrote:
> Thanks for your work on IPAddress.

Hello David,
thanks to you for your feedback.

> On occasion, I write scripts to
> process objects in firewall databases. In the past I've used Perl, but
> now I am using Ruby. In Perl, I've used Net::IP. It has a couple of
> things that would fit nicely in IPAddress.
>
> First, arbitrary range objects. Not defined by class or mask, just two
> addresses defining an arbitrary range.

This is a very interesting suggestion and I'm actually working on some nice
addition to include an IPAddress::Range class for IPAddress 0.9.0, to
be released
probably in September.

> Second, a great method called 'overlaps'. Here is description from
> Net::IP doc..
>
> "Check if two IP ranges/prefixes overlap each other. The value
> returned by the function should be one of: $IP_PARTIAL_OVERLAP (ranges
> overlap) $IP_NO_OVERLAP (no overlap) (IP_A_IN_B_OVERLAP (range2
> contains range1) $IP_B_IN_A_OVERLAP (range1 contains range2)
> $IP_IDENTICAL (ranges are identical) undef (problem)"

Would you consider this method for Range object types only or for canonical
IPAddress::IPv4 (or IPv6) objects? Because I'm very favorable in the
first case, it will
be a joy to implement in Ruby.

Thanks very much for your suggestions David. Stick around and we'll
see what 0.9.0 will bring! :)

Reply all
Reply to author
Forward
0 new messages