Package freenet.io.AddressIdentifier

Examples of freenet.io.AddressIdentifier.AddressType


          Socket clientSocket = serverSocket.accept();
          InetAddress clientAddress = clientSocket.getInetAddress();
          if(logMINOR)
            Logger.minor(Acceptor.class, "Connection from " + clientAddress);
         
          AddressType clientAddressType = AddressIdentifier.getAddressType(clientAddress.getHostAddress());

          /* check if the ip address is allowed */
          if (allowedHosts.allowed(clientAddressType, clientAddress) && acceptedSockets.size() <= maxQueueLength) {
            lock.lock();
            try {
View Full Code Here


      String allowedHost = allowedHostsTokens.nextToken().trim();
      String hostname = allowedHost;
      if (allowedHost.indexOf('/') != -1) {
        hostname = allowedHost.substring(0, allowedHost.indexOf('/'));
      }
      AddressType addressType = AddressIdentifier.getAddressType(hostname);
      if (addressType == AddressType.IPv4) {
        newAddressMatchers.add(new Inet4AddressMatcher(allowedHost));
      } else if (addressType == AddressType.IPv6) {
        newAddressMatchers.add(new Inet6AddressMatcher(allowedHost));
      } else if (allowedHost.equals("*")) {
View Full Code Here

      this.addressMatchers.addAll(newAddressMatchers);
    }
  }

  public boolean allowed(InetAddress clientAddress) {
    AddressType clientAddressType = AddressIdentifier.getAddressType(clientAddress.getHostAddress());
    return allowed(clientAddressType, clientAddress);
  }
View Full Code Here

TOP

Related Classes of freenet.io.AddressIdentifier.AddressType

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.