src/main/java/org/firepick/IPv4Scanner.java
public static Collection<InetAddress> scanRange(InetAddress addr, int count, int msTimeout) {
    Collection<InetAddress> addresses = new ArrayList<InetAddress>();
    Collection<InetAddress> result = new ArrayList<InetAddress>();
    if (addr == null) {
      try {
	addresses.addAll(localhostNetworkAddresses());
      } catch (Exception e) {
	throw new FireRESTException(e); // Should not happen
      }
    } else {
      addresses.add(addr);
    }

    for (InetAddress a: addresses) {
      if (a instanceof Inet4Address) {
	InetAddress start = subnetAddress0(a, 24);
	result.addAll(scanRangeCore(start, count, msTimeout));
      }
    }

    return result;
  }
public static Collection<InetAddress> scanRange(InetAddress addr, int count, int msTimeout) {
    Collection<InetAddress> addresses = new ArrayList<InetAddress>();
    Collection<InetAddress> result = new ArrayList<InetAddress>();
    if (addr == null) {
      try {
	addresses.addAll(localhostNetworkAddresses());
      } catch (Exception e) {
	throw new FireRESTException(e); // Should not happen
      }
    } else {
      addresses.add(addr);
    }

    for (InetAddress a: addresses) {
      if (a instanceof Inet4Address) {
	InetAddress start = subnetAddress0(a, 24);
	result.addAll(scanRangeCore(start, count, msTimeout));
      }
    }

    return result;
  }
public static Collection < InetAddress > scanRange ( InetAddress addr , int count , int msTimeout ) { Collection < InetAddress > addresses = new ArrayList < InetAddress > ( ) ; Collection < InetAddress > result = new ArrayList < InetAddress > ( ) ; if ( addr == null ) { try { addresses . addAll ( localhostNetworkAddresses ( ) ) ; } catch ( Exception e ) { throw new FireRESTException ( e ) ; // Should not happen } } else { addresses . add ( addr ) ; } for ( InetAddress a : addresses ) { if ( a instanceof Inet4Address ) { InetAddress start = subnetAddress0 ( a , 24 ) ; result . addAll ( scanRangeCore ( start , count , msTimeout ) ) ; } } return result ; }
Scan a range of InetAddresses starting with the given address

@param start starting address of search; null implies subnetAddress0(null,24)
@param count number of addresses in range
@param msTimeout maximum time to wait for each host
Scan a range of InetAddresses starting with the given address