code: private int computeNetworkPrefixFromMask(IPAddress mask) {
  		
  		int result = 0;
  		int tmp = mask.getIPAddress();
  		
  		while ((tmp & 0x00000001) == 0x00000001) {
  			result++;
  			tmp = tmp >>> 1;
  		}
  		
  		if (tmp != 0) {
  			return -1;
  		}
  		
  		return result;
  	}
docs: Compute the extended network prefix from the IP subnet mask.
  
  @param mask Reference to the subnet mask IP number.
  @return Return the extended network prefix. Return -1 if the specified
  mask cannot be converted into a extended prefix network.