Esempio n. 1
0
  /**
   * @return whether this RFD supports firewall-to-firewall transfer. For this to be true we need to
   *     have some push proxies, indication that the host supports FWT and we need to know that
   *     hosts' external address.
   */
  public final boolean supportsFWTransfer() {

    if (_host.equals(BOGUS_IP)
        || !NetworkUtils.isValidAddress(_host)
        || NetworkUtils.isPrivateAddress(_host)) return false;

    return _pushAddr == null ? false : _pushAddr.supportsFWTVersion() > 0;
  }
Esempio n. 2
0
  /**
   * @return true if I am not a multicast host and have a hash. also, if I am firewalled I must have
   *     at least one push proxy, otherwise my port and address need to be valid.
   */
  public final boolean isAltLocCapable() {
    boolean ret = getSHA1Urn() != null && !_replyToMulticast;

    if (_firewalled) ret = ret && _pushAddr != null && _pushAddr.getProxies().size() > 0;
    else
      ret =
          ret
              && NetworkUtils.isValidPort(_port)
              && !NetworkUtils.isPrivateAddress(_host)
              && NetworkUtils.isValidAddress(_host);

    return ret;
  }
Esempio n. 3
0
 /**
  * Determines whether or not this host reported a private address.
  *
  * @return <tt>true</tt> if the address for this host is private, otherwise <tt>false</tt>. If the
  *     address is unknown, returns <tt>true</tt>
  *     <p>TODO:: use InetAddress in this class for the host so that we don't have to go through
  *     the process of creating one each time we check it it's a private address
  */
 public final boolean isPrivate() {
   return NetworkUtils.isPrivateAddress(_host);
 }