[OpenSIPS-Devel] 2.4 new IP and Subnet comparison.

Adam Overbeeke Adam.Overbeeke at genesys.com
Thu Aug 9 09:35:51 EDT 2018


Hi Bogdan,

Thanks for confirming. I found out my error… embarrassing enough, I was pulling the wrong tag and was running against 2.3.3…. my apologies. After pulling the correct tag 2.4.1, I was able to retest and confirm that Option 3 worked as expect. As a follow up question, is it require that the CIDR ( eg. 10.10.10.0/24 ) be a static value in the comparison or is it possible to convert a variable to a CIDR “type”.

NOTE: Does not actually work - But here is an example of what I mean. Or some means to convert a string “10.10.10.0/24” to the CIDR value in the OPTION 3 ( 10.10.10.0/24 ).

  $var(input_ip) = "10.10.10.10";
  $var(input_x) = "10.10.10.0";
  $var(input_y) = 24;
  $var(input_z) = $(var(input_x){ip.pton})/$var(input_y);

  if ($var(input_ip) == $var(input_z))
      xlog("matched\n");

Thanks,

Adam

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/devel/attachments/20180809/1d96cfdd/attachment.html>


More information about the Devel mailing list