/** * 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(String inputString) { long inputIP = convert(inputString); long startIP = convert(poolStart); long endIP = convert(poolEnd); return (inputIP >= startIP && inputIP <= endIP); }
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; }
Iterator<NeutronSubnet_IPAllocationPool> i = allocationPools.iterator(); if (ipVersion == 4) { long sIP = NeutronSubnet_IPAllocationPool.convert(ipAddress); long lIP = NeutronSubnet_IPAllocationPool.convert(pool.getPoolStart()); long hIP = NeutronSubnet_IPAllocationPool.convert(pool.getPoolEnd()); if (sIP+1 == lIP) { hPool = pool;
public List<NeutronSubnet_IPAllocationPool> splitPool(String ipAddress) { List<NeutronSubnet_IPAllocationPool> ans = new ArrayList<NeutronSubnet_IPAllocationPool>(); long gIP = NeutronSubnet_IPAllocationPool.convert(ipAddress); long sIP = NeutronSubnet_IPAllocationPool.convert(poolStart); long eIP = NeutronSubnet_IPAllocationPool.convert(poolEnd); long i; NeutronSubnet_IPAllocationPool p = new NeutronSubnet_IPAllocationPool();