You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lenya.apache.org by mi...@apache.org on 2003/07/24 18:29:50 UTC

cvs commit: cocoon-lenya/src/java/org/apache/lenya/cms/ac FileIPRange.java

michi       2003/07/24 09:29:50

  Modified:    src/java/org/apache/lenya/cms/ac FileIPRange.java
  Log:
  testing ...
  
  Revision  Changes    Path
  1.2       +25 -2     cocoon-lenya/src/java/org/apache/lenya/cms/ac/FileIPRange.java
  
  Index: FileIPRange.java
  ===================================================================
  RCS file: /home/cvs/cocoon-lenya/src/java/org/apache/lenya/cms/ac/FileIPRange.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- FileIPRange.java	22 Jul 2003 17:01:34 -0000	1.1
  +++ FileIPRange.java	24 Jul 2003 16:29:50 -0000	1.2
  @@ -1,5 +1,4 @@
   /*
  -$Id$
   <License>
   
    ============================================================================
  @@ -65,9 +64,33 @@
   /**
    * IP range that is stored in a file.
    * 
  - * @author andreas
  + * @author Andreas Hartmann
  + * @author Michael Wechner
  + * @version $Id$
    */
   public class FileIPRange extends IPRange {
  +
  +    /**
  +     *
  +     */
  +    public static void main(String[] args) {
  +        if (args.length == 0) {
  +            System.out.println("Usage: network, netmask, ip (e.g. 192.168.0.64 255.255.255.240 192.168.0.70)");
  +            return;
  +        }
  +        IPRange ipr = new FileIPRange();
  +        try {
  +            ipr.setNetworkAddress(args[0]);
  +            ipr.setSubnetMask(args[1]);
  +            if (ipr.contains(new Machine(args[2]))) {
  +                System.out.println("true");
  +            } else {
  +                System.out.println("false");
  +            }
  +        } catch(Exception e) {
  +            System.err.println(e);
  +        }
  +    }
   
       /**
        * Ctor.
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: lenya-cvs-unsubscribe@cocoon.apache.org
For additional commands, e-mail: lenya-cvs-help@cocoon.apache.org