Examples of InetNetwork


Examples of com.caucho.util.InetNetwork

        return true;
    }

    if (_forbiddenNets != null) {
      for (int i = _forbiddenNets.size(); i >= 0; i--) {
        InetNetwork net = (InetNetwork) _forbiddenNets.get(i);

        if (net.isMatch(addr))
          return true;
      }
    }

    return false;
View Full Code Here

Examples of com.caucho.util.InetNetwork

    constraint.init();
    webAppConfig.addBuilderProgram(new PropertyValueProgram("security-constraint", constraint));

    try {
      _allowedNetworks = new InetNetwork[] {
        new InetNetwork(InetAddress.getByName("127.0.0.1"), 24),
        new InetNetwork(InetAddress.getByName("10.0.0.0"), 24),
        new InetNetwork(InetAddress.getByName("172.16.0.0"), 20),
        new InetNetwork(InetAddress.getByName("192.168.0.0"), 16),
      };
    } catch (UnknownHostException e) {
      throw new RuntimeException(e);
    }
  }
View Full Code Here

Examples of org.apache.james.dnsservice.library.inetnetwork.model.InetNetwork

    public boolean matchInetNetwork(final InetAddress ip) {

        boolean sameNet = false;

        for (Iterator<InetNetwork> iter = networks.iterator(); (!sameNet) && iter.hasNext();) {
            InetNetwork network = iter.next();
            sameNet = network.contains(ip);
        }

        return sameNet;

    }
View Full Code Here

Examples of org.apache.james.dnsservice.library.inetnetwork.model.InetNetwork

        final InetNetworkBuilder inetNetwork = new InetNetworkBuilder(dnsServer);

        for (String net : nets) {
            try {
                InetNetwork inet = inetNetwork.getFromString(net);
                networks.add(inet);
            } catch (UnknownHostException uhe) {
                log("Cannot resolve address: " + uhe.getMessage());
            }
        }
View Full Code Here

Examples of org.apache.james.util.inetnetwork.model.InetNetwork

        final InetNetworkBuilder inetNetwork = new InetNetworkBuilder(dnsServer);

        for (String net: nets) {
            try {
                InetNetwork inet = inetNetwork.getFromString(net);
                networks.add(inet);
            } catch (UnknownHostException uhe) {
                log("Cannot resolve address: " + uhe.getMessage());
            }
        }
View Full Code Here

Examples of org.apache.james.util.inetnetwork.model.InetNetwork

    public boolean matchInetNetwork(final InetAddress ip) {
       
        boolean sameNet = false;

        for (Iterator<InetNetwork> iter = networks.iterator(); (!sameNet) && iter.hasNext();) {
            InetNetwork network = iter.next();
            sameNet = network.contains(ip);
        }
       
        return sameNet;
   
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.