Exemplo n.º 1
0
  static void readConfig() {
    tracker_ip = COConfigurationManager.getStringParameter("Tracker IP", "");

    tracker_ip = UrlUtils.expandIPV6Host(tracker_ip);

    String override_ips = COConfigurationManager.getStringParameter("Override Ip", "");

    StringTokenizer tok = new StringTokenizer(override_ips, ";");

    Map new_override_map = new HashMap();

    while (tok.hasMoreTokens()) {

      String ip = tok.nextToken().trim();

      if (ip.length() > 0) {

        new_override_map.put(AENetworkClassifier.categoriseAddress(ip), ip);
      }
    }

    override_map = new_override_map;

    InetAddress bad = NetworkAdmin.getSingleton().getSingleHomedServiceBindAddress();

    if (bad == null || bad.isAnyLocalAddress()) {

      bind_ip = "";

    } else {

      bind_ip = bad.getHostAddress();
    }
  }
Exemplo n.º 2
0
 public static boolean isHosting(URL url_in) {
   return (tracker_ip.length() > 0
       && UrlUtils.expandIPV6Host(url_in.getHost()).equalsIgnoreCase(tracker_ip));
 }