1 16 package org.apache.lenya.net; 17 18 import java.net.InetAddress ; 19 20 23 public class InetAddressUtilTest { 24 27 public static void main(String [] args) { 28 if (args.length != 3) { 29 System.out.println("Usage: " + new InetAddressUtilTest().getClass().getName() + " network subnet ip"); 30 return; 31 } 32 33 try { 34 InetAddress network = InetAddress.getByName(args[0]); InetAddress subnet = InetAddress.getByName(args[1]); InetAddress ip = InetAddress.getByName(args[2]); System.out.println(InetAddressUtil.contains(network, subnet, ip)); 38 } catch(Exception e) { 39 System.err.println(e); 40 } 41 } 42 } 43 | Popular Tags |