[OpenSIPS-Users] check if ip address belongs to ip and subnet subscriber

Stefano Pisani stefano.pisani at omnianet.it
Thu Jan 30 21:32:56 CET 2014


$var(mask) = "255.255.0.0";
$var(ip) = "192.168.2.134";
$var(net) = $(var(mask){ip.pton}) & $(var(ip){ip.pton});

if ($(var(net){ip.ntop}) == "192.168.0.0")
      xlog("IP is in 192.168.0.0/16 network\n");

Il 30/01/2014 20.47, Edwin ha scritto:
> Stefano,
>
> I know,  and maybe I will use the permission module if needed, but the
> question / topic is about using the ip.pton function.
>
> I would appreciate if you (or anyone else) could help me with this question.
> Use and output of ip.pton is still opaque to me...
>
> Thanks,
>
> Edwin
>
>
>
> --
> View this message in context: http://opensips-open-sip-server.1449251.n2.nabble.com/check-if-ip-address-belongs-to-ip-and-subnet-subscriber-tp7589375p7589391.html
> Sent from the OpenSIPS - Users mailing list archive at Nabble.com.
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>




More information about the Users mailing list