Sun Java System Web Proxy Server 4.0.8 Administration Guide

isInNet()(host, pattern, mask)

The isInNet()() function enables you to resolve a URL host name to an IP address and test whether it belongs to the subnet specified by the mask. This is the same type of IP address pattern matching that SOCKS uses. See Example 4: Connect Directly to a Subnet.

Parameters:

host is a DNS host name or IP address. If a host name is passed, this function will resolve it into an IP address.

pattern is an IP address pattern in the dot-separated format

mask is the IP address pattern mask that determines which parts of the IP address should be matched against. A value of 0 means ignore; 255 means match. This function is true if the IP address of the host matches the specified IP address pattern.

Return Values

true or false

Examples

This statement is true only if the IP address of the host matches exactly 198.95.249.79 exactly:

isInNet(host, "198.95.249.79", "255.255.255.255")

This statement is true only if the IP address of the host matches 198.95.*.*: isInNet(host, "198.95.0.0", "255.255.0.0")