Package org.apache.commons.net.util

Examples of org.apache.commons.net.util.SubnetUtils


        new SubnetUtils("192.168.0.1/1");
    }
   
    public void testInvalidMasks(){
        try {
            new SubnetUtils("192.168.0.1/33");
            fail("Should have thrown IllegalArgumentException");
        } catch (IllegalArgumentException expected) {
        }
        try {
            new SubnetUtils("192.168.0.1/0");
            fail("Should have thrown IllegalArgumentException");
        } catch (IllegalArgumentException expected) {
        }
        try {
            new SubnetUtils("192.168.0.1","0.0.0.0");
            fail("Should have thrown IllegalArgumentException");
        } catch (IllegalArgumentException expected) {
        }
    }
View Full Code Here


        vn.setParent(vCenterProject);
        String ipamUuid = apiConnector.findByName(NetworkIpam.class, null,
                "default-network-ipam");
        NetworkIpam ipam = (NetworkIpam) apiConnector.findById(
                NetworkIpam.class, ipamUuid);
        SubnetUtils subnetUtils = new SubnetUtils(subnetAddr, subnetMask)
        String cidr = subnetUtils.getInfo().getCidrSignature();
        VnSubnetsType subnet = new VnSubnetsType();
        String[] addr_pair = cidr.split("\\/");
        subnet.addIpamSubnets(new VnSubnetsType.IpamSubnetType(
                                   new SubnetType(addr_pair[0],
                                       Integer.parseInt(addr_pair[1])), gatewayAddr,
View Full Code Here

TOP

Related Classes of org.apache.commons.net.util.SubnetUtils

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.