On 05/10/2017 03:54 PM, Felix Schmidt wrote:
> Hi,
>
> I'm new to prolog. I have a questions for you experts. I was using
> google already, but haven't found a solution yet.
This isn't really the Prolog thingy as it is mostly bit manipulation,
but it can (of course) be done. See
http://swish.swi-prolog.org/p/cidr.pl
Enjoy --- Jan
>
> I want to do CIDR matching in Prolog.
>
> Basically what I would like to do is the following:
>
> cidr(
10.0.0.0/24)
>
> ip(10.0.0.1) -> How can I check that this IP is a match based on the CIDR?
> ip(10.0.1.1) -> This IP would be no match.
>
> Thanks
> - felix
>
> --
> You received this message because you are subscribed to the Google
> Groups "SWI-Prolog" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to
swi-prolog+...@googlegroups.com
> <mailto:
swi-prolog+...@googlegroups.com>.
> Visit this group at
https://groups.google.com/group/swi-prolog.
> For more options, visit
https://groups.google.com/d/optout.