Search in sources :

Example 1 with FwFromSourceAddressExcept

use of org.batfish.representation.juniper.FwFromSourceAddressExcept in project batfish by batfish.

the class ConfigurationBuilder method exitFftf_source_address.

@Override
public void exitFftf_source_address(Fftf_source_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 FwFromSourceAddressExcept(prefix);
        } else {
            from = new FwFromSourceAddress(prefix);
        }
        _currentFwTerm.getFroms().add(from);
    }
}
Also used : FwFromSourceAddressExcept(org.batfish.representation.juniper.FwFromSourceAddressExcept) PsThenNextHopIp(org.batfish.representation.juniper.PsThenNextHopIp) FwThenNextIp(org.batfish.representation.juniper.FwThenNextIp) Ip(org.batfish.datamodel.Ip) FwFromSourceAddress(org.batfish.representation.juniper.FwFromSourceAddress) FwFrom(org.batfish.representation.juniper.FwFrom) Prefix(org.batfish.datamodel.Prefix)

Aggregations

Ip (org.batfish.datamodel.Ip)1 Prefix (org.batfish.datamodel.Prefix)1 FwFrom (org.batfish.representation.juniper.FwFrom)1 FwFromSourceAddress (org.batfish.representation.juniper.FwFromSourceAddress)1 FwFromSourceAddressExcept (org.batfish.representation.juniper.FwFromSourceAddressExcept)1 FwThenNextIp (org.batfish.representation.juniper.FwThenNextIp)1 PsThenNextHopIp (org.batfish.representation.juniper.PsThenNextHopIp)1