This is the documentation for the development version. There are no official binaries for it; build it from the source code in git. Download links on these pages work only after the release. For the current release, see version 7.0.

AddrInSubnet()

Deprecated in 5.0.

Please use sameSubnet() method of InetAddress class.

AddrInSubnet(address, subnet, mask): bool

Checks if given IP address is within given subnet (including subnet and broadcast addresses). IPv4 and IPv6 are supported.

Table 1. Parameters

address

String

IP address to check.

subnet

String

Subnet address.

mask

String

Subnet mask, either decimal dotted notation or CIDR notation.

Return

TRUE if address is within given subnet (including subnet and broadcast addresses), and FALSE otherwise.

AddrInSubnet("10.0.0.16", "10.0.0.0", "24")		//TRUE
AddrInSubnet("10.0.0.16", "192.168.1.0", "255.255.255.0")	//FALSE