2011/4/28 Henning Westerholt <[email protected]>:
> Hello,
>
> i like to also not see much more of this small utility modules, in the end its
> just a text operation, as you've said.

Ok. I'm coding it right now in a new module but just for testing
purposes (which is easier than modify existing core parts).


> Another question, have you thought about extending the existing "equals"
> operator that it works also for IPv6 address? Just like for IPv4 addresses
> where it already understands network masks, e.g.:
>
> if ($si == 192.168.1.1/32) {..}
> if ($si == 192.168.1.1) {..}
>
> it could do this binary comparison inside as well for v6.

Interesting. However, in case the second argument is a pv (i.e.
retrieved from a DB) "equal" operator would not work as expected, am I
right?
This is the reason I'm coding a function "compare_ips" which allow
IPv4, IPv6, IPv6-reference (string or pv).

Maybe another function could be created:   is_ip_in(IP, NETWORK)

-- 
Iñaki Baz Castillo
<[email protected]>

_______________________________________________
sr-dev mailing list
[email protected]
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev

Reply via email to