/** * This method determines if this allocation pool contains the * input IPv4 address * * @param inputString * IPv4 address in dotted decimal format * @returns a boolean on whether the pool contains the address or not */ public boolean contains_V6(String inputString) { BigInteger inputIP = convert_V6(inputString); BigInteger startIP = convert_V6(poolStart); BigInteger endIP = convert_V6(poolEnd); return (inputIP.compareTo(startIP) >= 0 && inputIP.compareTo(endIP) <= 0); }
public String getLowAddr() { String ans = null; Iterator<NeutronSubnet_IPAllocationPool> i = allocationPools.iterator(); while (i.hasNext()) { NeutronSubnet_IPAllocationPool pool = i.next(); if (ans == null) { ans = pool.getPoolStart(); } else { if (ipVersion == 4) { if (NeutronSubnet_IPAllocationPool.convert(pool.getPoolStart()) < NeutronSubnet_IPAllocationPool.convert(ans)) { ans = pool.getPoolStart(); } } if (ipVersion == 6) { if (NeutronSubnet_IPAllocationPool.convert_V6(pool.getPoolStart()).compareTo(NeutronSubnet_IPAllocationPool.convert_V6(ans)) < 0) { ans = pool.getPoolStart(); } } } } return ans; }
public List<NeutronSubnet_IPAllocationPool> splitPool_V6(String ipAddress) { List<NeutronSubnet_IPAllocationPool> ans = new ArrayList<NeutronSubnet_IPAllocationPool>(); BigInteger gIP = NeutronSubnet_IPAllocationPool.convert_V6(ipAddress); BigInteger sIP = NeutronSubnet_IPAllocationPool.convert_V6(poolStart); BigInteger eIP = NeutronSubnet_IPAllocationPool.convert_V6(poolEnd); if (gIP.compareTo(sIP) == 0 && gIP.compareTo(eIP) < 0) { NeutronSubnet_IPAllocationPool p = new NeutronSubnet_IPAllocationPool();
BigInteger sIP = NeutronSubnet_IPAllocationPool.convert_V6(ipAddress); BigInteger lIP = NeutronSubnet_IPAllocationPool.convert_V6(pool.getPoolStart()); BigInteger hIP = NeutronSubnet_IPAllocationPool.convert_V6(pool.getPoolEnd()); if (lIP.compareTo(sIP.add(BigInteger.ONE)) == 0) { hPool = pool;
BigInteger lowAddress_bi = NeutronSubnet_IPAllocationPool.convert_V6(parts[0]); String lowAddress = NeutronSubnet_IPAllocationPool.bigIntegerToIP(lowAddress_bi.add(BigInteger.ONE)); BigInteger mask = BigInteger.ONE.shiftLeft(length).subtract(BigInteger.ONE);