[ 
https://issues.apache.org/jira/browse/NET-189?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Kenny MacLeod updated NET-189:
------------------------------

    Attachment: IpRangeFilterTest.java
                IpRangeFilter.java

Funny you should ask that!  See attached code and unit test.

After thinking about this issue a bit more, it was clear that converting a 
network/netmask into a set of ip addresses would be potentially very 
inefficient, and that all we really needed was a way of finding out if a given 
IP address was part of a given IP range, using bitwise mask operations.  The 
result is very quick indeed.

It doesn't support the specification of the netmask in terms of 
"10.1.0.0/255.255.0.0" format, since I find that that's unnecessary 
flexibility, and that the standard "10.1.0.0/16" format is sufficient.

> Add netmask translation feature
> -------------------------------
>
>                 Key: NET-189
>                 URL: https://issues.apache.org/jira/browse/NET-189
>             Project: Commons Net
>          Issue Type: New Feature
>            Reporter: Kenny MacLeod
>            Priority: Minor
>         Attachments: IpRangeFilter.java, IpRangeFilterTest.java
>
>
> Java is sorely lacking in a good quality open source APi for translating 
> standard IP netmasks, e.g.
> 10.1.0.0/16 
> 83.217.112.18/255.255.255.240
> 10.1.0.*
> etc etc
> These sorts of masks are commonly used in the likes of Apache web server, and 
> I would really like to use them in java.  A utlity to translate them into 
> sequences of InetAddress objects would be perfect.
> Commons-Net would seem like a good project to put them in.
> Thoughts?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to