public boolean isInNet(String host,String pattern,String mask){
  host=dnsResolve(host);
  if (host == null || host.length() == 0) {
    return false;
  }
  long lhost=parseIpAddressToLong(host);
  long lpattern=parseIpAddressToLong(pattern);
  long lmask=parseIpAddressToLong(mask);
  return (lhost & lmask) == lpattern;
}

public boolean isInNet ( String host , String pattern , String mask ) { host = dnsResolve ( host ) ; if ( host == null || host . length ( ) == 0 ) { return false ; } long lhost = parseIpAddressToLong ( host ) ; long lpattern = parseIpAddressToLong ( pattern ) ; long lmask = parseIpAddressToLong ( mask ) ; return ( lhost & lmask ) == lpattern ; }
returns true if the ip address of the host matches the specified ip address pattern . pattern and mask specification is done the same way as for socks configuration . example : isinnet ( host , " 198 . 95 . 0 . 0 " , " 255 . 255 . 0 . 0 " ) is true if the ip address of the host matches 198 . 95 . * . * .
