NetXMS Support Forum

English Support => General Support => Topic started by: scuq on March 31, 2014, 02:05:45 AM

Title: Automatic Bind Rules - AddrInSubnet
Post by: scuq on March 31, 2014, 02:05:45 AM
if (AddrInSubnet($node->ipAddr, "10.16.0.0", "255.255.0.0")) {
return;
}


is this valid syntax?
Title: Re: Automatic Bind Rules - AddrInSubnet
Post by: Borgso on March 31, 2014, 09:38:15 AM
Just tried this command and it worked.

http://wiki.netxms.org/wiki/NXSL:AddrInSubnet

if (AddrInSubnet($node->ipAddr, "10.0.0.0", "255.255.255.0")) {
  return true;
}
Title: Re: Automatic Bind Rules - AddrInSubnet
Post by: Victor Kirhenshtein on March 31, 2014, 11:38:46 AM
Quote from: scuq on March 31, 2014, 02:05:45 AM
if (AddrInSubnet($node->ipAddr, "10.16.0.0", "255.255.0.0")) {
return;
}


is this valid syntax?

Syntax is valid, but depending on context (for example if you are writing a filter script) you may need to return TRUE or FALSE instead of null value.

Best regards,
Victor