Package com.caucho.util

Examples of com.caucho.util.InetNetwork


      return false;
    }

    boolean isMatch = false;
    for (int i = 0; i < _networkList.size(); i++) {
      InetNetwork net = _networkList.get(i);
     
      if (net.isMatch(addr)) {
        isMatch = true;
        break;
      }
    }
   
View Full Code Here


      // if no allow specified, then allow all
      allow = true;
    }
    else {
      for (int i = 0; i < _allowNetworkList.size(); i++) {
        InetNetwork net = _allowNetworkList.get(i);

        if (net.isMatch(addr)) {
          allow = true;
          break;
        }
      }
    }

    // check deny

    if (allow && _denyNetworkList != null) {
      for (int i = 0; i < _denyNetworkList.size(); i++) {
        InetNetwork net = _denyNetworkList.get(i);

        if (net.isMatch(addr)) {
          allow = false;
          break;
        }
      }
    }
View Full Code Here

   * Adds a forbidden net.
   */
  public void addForbidNet(String netmask)
  {
    try {
      InetNetwork net = InetNetwork.create(netmask);

      if (net == null)
        return;

      if (_forbiddenNets == null)
View Full Code Here

   * Removes a forbidden net.
   */
  public void removeForbidNet(String netmask)
  {
    try {
      InetNetwork net = InetNetwork.create(netmask);

      if (net == null)
        return;

      if (_forbiddenNets != null)
View Full Code Here

        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

    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

      return false;
    }

    boolean isMatch = false;
    for (int i = 0; i < _networkList.size(); i++) {
      InetNetwork net = _networkList.get(i);
     
      if (net.isMatch(addr)) {
  isMatch = true;
  break;
      }
    }
   
View Full Code Here

      // if no allow specified, then allow all
      allow = true;
    }
    else {
      for (int i = 0; i < _allowNetworkList.size(); i++) {
        InetNetwork net = _allowNetworkList.get(i);

        if (net.isMatch(addr)) {
          allow = true;
          break;
        }
      }
    }

    // check deny

    if (allow && _denyNetworkList != null) {
      for (int i = 0; i < _denyNetworkList.size(); i++) {
        InetNetwork net = _denyNetworkList.get(i);

        if (net.isMatch(addr)) {
          allow = false;
          break;
        }
      }
    }
View Full Code Here

   * Adds a forbidden net.
   */
  public void addForbidNet(String netmask)
  {
    try {
      InetNetwork net = InetNetwork.create(netmask);

      if (net == null)
        return;

      if (_forbiddenNets == null)
View Full Code Here

   * Removes a forbidden net.
   */
  public void removeForbidNet(String netmask)
  {
    try {
      InetNetwork net = InetNetwork.create(netmask);

      if (net == null)
        return;

      if (_forbiddenNets != null)
View Full Code Here

TOP

Related Classes of com.caucho.util.InetNetwork

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.