use of org.batfish.representation.juniper.FwFromDestinationAddress in project batfish by batfish.
the class ConfigurationBuilder method exitFftf_destination_address.
@Override
public void exitFftf_destination_address(Fftf_destination_addressContext ctx) {
if (ctx.IP_ADDRESS() != null || ctx.IP_PREFIX() != null) {
Prefix prefix;
if (ctx.IP_PREFIX() != null) {
prefix = Prefix.parse(ctx.IP_PREFIX().getText());
} else {
prefix = new Prefix(new Ip(ctx.IP_ADDRESS().getText()), Prefix.MAX_PREFIX_LENGTH);
}
FwFrom from;
if (ctx.EXCEPT() != null) {
from = new FwFromDestinationAddressExcept(prefix);
} else {
from = new FwFromDestinationAddress(prefix);
}
_currentFwTerm.getFroms().add(from);
}
}
Aggregations