use of inet.ipaddr.IPAddressSeqRange in project onos by opennetworkinglab.
the class KubevirtIpPool method getRangedIps.
/**
* Obtains the IP address list from the given start and end range.
*
* @param start start range
* @param end end range
* @return IP address list from the given start and end range
* @throws AddressStringException exception
*/
public Set<IpAddress> getRangedIps(String start, String end) throws AddressStringException {
Set<IpAddress> ips = new HashSet<>();
IPAddress lower = new IPAddressString(start).toAddress();
IPAddress upper = new IPAddressString(end).toAddress();
IPAddressSeqRange range = lower.toSequentialRange(upper);
for (IPAddress addr : range.getIterable()) {
ips.add(IpAddress.valueOf(addr.toString()));
}
return ips;
}
Aggregations