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