use of net.ripe.ipresource.IpRange in project rpki-validator-3 by RIPE-NCC.
the class BgpRisDownloader method parseLine.
private BgpRisEntry parseLine(final String line, final Function<Object, Object> uniq) {
final Matcher matcher = regexp.matcher(line);
if (matcher.matches()) {
final Asn asn = (Asn) uniq.apply(Asn.parse(matcher.group(1)));
IpRange parsed = IpRange.parse(matcher.group(2));
final UniqueIpResource start = (UniqueIpResource) uniq.apply(parsed.getStart());
final UniqueIpResource end = (UniqueIpResource) uniq.apply(parsed.getEnd());
final IpRange prefix = (IpRange) start.upTo(end);
final int visibility = Integer.parseInt(matcher.group(3));
return BgpRisEntry.of(asn, prefix, visibility);
}
return null;
}
Aggregations