class Platform {

  String produceLinkLocalIp() {
    try {
      Enumeration<NetworkInterface> nics = NetworkInterface.getNetworkInterfaces();
      while (nics.hasMoreElements()) {
        NetworkInterface nic = nics.nextElement();
        Enumeration<InetAddress> addresses = nic.getInetAddresses();
        while (addresses.hasMoreElements()) {
          InetAddress address = addresses.nextElement();
          if (address.isSiteLocalAddress()) return address.getHostAddress();
        }
      }
    } catch (Exception e) {
      // don't crash the caller if there was a problem reading nics.
      log("error reading nics", e);
    }
    return null;
  }

}