For Programmers: Free Programming Magazines  


Home > Archive > PERL Miscellaneous > May 2004 > aggregating single IP addresses into CIDRs?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author aggregating single IP addresses into CIDRs?
Gerald Jones

2004-05-18, 6:31 pm

Is there a perl way to take a list of IP unordered addresses in dotted quad
format and group them into more compact CIDR format?

TIA,
Gerald.
Josef Moellers

2004-05-19, 3:31 am

Gerald Jones wrote:
> Is there a perl way to take a list of IP unordered addresses in dotted =

quad
> format and group them into more compact CIDR format?


How about :
Convert to integer (doable if IPv4)
Or into one integer
Find the least significant "1".
Done

--=20
Josef M=F6llers (Pinguinpfleger bei FSC)
If failure had no penalty success would not be a prize
-- T. Pratchett

John W. Krahn

2004-05-19, 7:31 pm

Gerald Jones wrote:
>
> Is there a perl way to take a list of IP unordered addresses in dotted quad
> format and group them into more compact CIDR format?


http://search.cpan.org/search?query=CIDR&mode=module


John
--
use Perl;
program
fulfillment
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com