Search in sources :

Example 1 with FwFromIcmpType

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

the class ConfigurationBuilder method exitFftf_icmp_type.

@Override
public void exitFftf_icmp_type(Fftf_icmp_typeContext ctx) {
    if (_currentFirewallFamily == Family.INET6) {
        // TODO: support icmpv6
        return;
    }
    SubRange icmpTypeRange;
    if (ctx.subrange() != null) {
        icmpTypeRange = toSubRange(ctx.subrange());
    } else if (ctx.icmp_type() != null) {
        int icmpType = toIcmpType(ctx.icmp_type());
        icmpTypeRange = new SubRange(icmpType, icmpType);
    } else {
        throw new BatfishException("Invalid icmp-type");
    }
    FwFrom from = new FwFromIcmpType(icmpTypeRange);
    _currentFwTerm.getFroms().add(from);
}
Also used : BatfishException(org.batfish.common.BatfishException) FwFromIcmpType(org.batfish.representation.juniper.FwFromIcmpType) FwFrom(org.batfish.representation.juniper.FwFrom) SubRange(org.batfish.datamodel.SubRange)

Aggregations

BatfishException (org.batfish.common.BatfishException)1 SubRange (org.batfish.datamodel.SubRange)1 FwFrom (org.batfish.representation.juniper.FwFrom)1 FwFromIcmpType (org.batfish.representation.juniper.FwFromIcmpType)1