PHP Classes

IP ranges

Recommend this page to a friend!

      Aggregator  >  All threads  >  IP ranges  >  (Un) Subscribe thread alerts  
Subject:IP ranges
Summary:How to handle IP ranges in start-end format?
Messages:4
Author:Dave
Date:2018-04-06 00:33:43
 

  1. IP ranges   Reply   Report abuse  
Picture of Dave Dave - 2018-04-06 00:33:43
Howdy!

Is there a way to handle IP ranges such as 10.0.0.0-10.2.255.255, with the expected result being:

10.0.0.0/15
10.2.0.0/16

And similar for IPv6?

  2. Re: IP ranges   Reply   Report abuse  
Picture of Caleb Caleb - 2018-04-06 03:41:56 - In reply to message 1 from Dave
Hi Dave,

Currently, Aggregator can accept IPs (x.x.x.x, x:x:x:x::x/yy, etc), and can accept CIDR-notated subnets (or CIDRs; x.x.x.x/yy, x:x:x:x::x/yy) as input, but it doesn't yet recognise arbitrary netmasks or ranges using notations other than CIDR and so on (like x.x.x.x-y.y.y.y).

Within the limits of accepted input though, it fully supports both IPv4 and IPv6.

I'll see what I can do in terms of additional accepted input types for the next version. :-)

Kind regards,
Caleb M / Maikuolan.

  3. Re: IP ranges   Reply   Report abuse  
Picture of Dave Dave - 2018-04-06 03:50:09 - In reply to message 2 from Caleb
Fair enough, thanks. Since posting I was able to get initial support for IPv4 ranges working with the help of another project, but IPv6 is currently beyond me. Also, my code is sloppy and terrible.

I’d love to see range inputs added, but I’ll also note back if I get a working IPv6 solution and can contribute back.

Thanks!

  4. Re: IP ranges   Reply   Report abuse  
Picture of Caleb Caleb - 2019-01-09 11:13:42 - In reply to message 3 from Dave
Still working on numbered ranges. Support for netmasks has now been implemented though. :-)

PS, sorry for the delay! ^.^