use of org.batfish.representation.cisco.OspfWildcardNetwork in project batfish by batfish.
the class CiscoControlPlaneExtractor method exitRo_network.
@Override
public void exitRo_network(Ro_networkContext ctx) {
Ip address;
Ip wildcard;
if (ctx.prefix != null) {
Prefix prefix = Prefix.parse(ctx.prefix.getText());
address = prefix.getStartIp();
wildcard = prefix.getPrefixWildcard();
} else {
address = toIp(ctx.ip);
wildcard = toIp(ctx.wildcard);
}
if (_configuration.getVendor() == ConfigurationFormat.CISCO_ASA) {
wildcard = wildcard.inverted();
}
long area;
if (ctx.area_int != null) {
area = toLong(ctx.area_int);
} else if (ctx.area_ip != null) {
area = toIp(ctx.area_ip).asLong();
} else {
throw new BatfishException("bad area");
}
OspfWildcardNetwork network = new OspfWildcardNetwork(address, wildcard, area);
_currentOspfProcess.getWildcardNetworks().add(network);
}
Aggregations