Search in sources :

Example 1 with FwFromDestinationAddress

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);
    }
}
Also used : PsThenNextHopIp(org.batfish.representation.juniper.PsThenNextHopIp) FwThenNextIp(org.batfish.representation.juniper.FwThenNextIp) Ip(org.batfish.datamodel.Ip) FwFromDestinationAddressExcept(org.batfish.representation.juniper.FwFromDestinationAddressExcept) FwFrom(org.batfish.representation.juniper.FwFrom) Prefix(org.batfish.datamodel.Prefix) FwFromDestinationAddress(org.batfish.representation.juniper.FwFromDestinationAddress)

Aggregations

Ip (org.batfish.datamodel.Ip)1 Prefix (org.batfish.datamodel.Prefix)1 FwFrom (org.batfish.representation.juniper.FwFrom)1 FwFromDestinationAddress (org.batfish.representation.juniper.FwFromDestinationAddress)1 FwFromDestinationAddressExcept (org.batfish.representation.juniper.FwFromDestinationAddressExcept)1 FwThenNextIp (org.batfish.representation.juniper.FwThenNextIp)1 PsThenNextHopIp (org.batfish.representation.juniper.PsThenNextHopIp)1