Search in sources :

Example 1 with FwFrom

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

the class ConfigurationBuilder method exitFftf_fragment_offset.

@Override
public void exitFftf_fragment_offset(Fftf_fragment_offsetContext ctx) {
    SubRange subRange = toSubRange(ctx.subrange());
    FwFrom from = new FwFromFragmentOffset(subRange, false);
    _currentFwTerm.getFroms().add(from);
}
Also used : FwFromFragmentOffset(org.batfish.representation.juniper.FwFromFragmentOffset) FwFrom(org.batfish.representation.juniper.FwFrom) SubRange(org.batfish.datamodel.SubRange)

Example 2 with FwFrom

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

the class ConfigurationBuilder method exitFftf_tcp_established.

@Override
public void exitFftf_tcp_established(Fftf_tcp_establishedContext ctx) {
    List<TcpFlags> tcpFlags = new ArrayList<>();
    TcpFlags alt1 = new TcpFlags();
    alt1.setUseAck(true);
    alt1.setAck(true);
    tcpFlags.add(alt1);
    TcpFlags alt2 = new TcpFlags();
    alt2.setUseRst(true);
    alt2.setRst(true);
    tcpFlags.add(alt2);
    FwFrom from = new FwFromTcpFlags(tcpFlags);
    _currentFwTerm.getFroms().add(from);
}
Also used : TcpFlags(org.batfish.datamodel.TcpFlags) FwFromTcpFlags(org.batfish.representation.juniper.FwFromTcpFlags) ArrayList(java.util.ArrayList) FwFrom(org.batfish.representation.juniper.FwFrom) FwFromTcpFlags(org.batfish.representation.juniper.FwFromTcpFlags)

Example 3 with FwFrom

use of org.batfish.representation.juniper.FwFrom 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)

Example 4 with FwFrom

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

the class ConfigurationBuilder method exitFftf_packet_length_except.

@Override
public void exitFftf_packet_length_except(Fftf_packet_length_exceptContext ctx) {
    List<SubRange> range = toRange(ctx.range());
    FwFrom from = new FwFromPacketLength(range, true);
    _currentFwTerm.getFroms().add(from);
}
Also used : FwFromPacketLength(org.batfish.representation.juniper.FwFromPacketLength) FwFrom(org.batfish.representation.juniper.FwFrom) SubRange(org.batfish.datamodel.SubRange)

Example 5 with FwFrom

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

the class ConfigurationBuilder method exitFftf_is_fragment.

@Override
public void exitFftf_is_fragment(Fftf_is_fragmentContext ctx) {
    SubRange subRange = new SubRange(0, 0);
    FwFrom from = new FwFromFragmentOffset(subRange, true);
    _currentFwTerm.getFroms().add(from);
}
Also used : FwFromFragmentOffset(org.batfish.representation.juniper.FwFromFragmentOffset) FwFrom(org.batfish.representation.juniper.FwFrom) SubRange(org.batfish.datamodel.SubRange)

Aggregations

FwFrom (org.batfish.representation.juniper.FwFrom)19 SubRange (org.batfish.datamodel.SubRange)11 FwFromFragmentOffset (org.batfish.representation.juniper.FwFromFragmentOffset)4 TcpFlags (org.batfish.datamodel.TcpFlags)3 SubrangeContext (org.batfish.grammar.flatjuniper.FlatJuniperParser.SubrangeContext)3 FwFromTcpFlags (org.batfish.representation.juniper.FwFromTcpFlags)3 ArrayList (java.util.ArrayList)2 BatfishException (org.batfish.common.BatfishException)2 Ip (org.batfish.datamodel.Ip)2 Prefix (org.batfish.datamodel.Prefix)2 FwFromPacketLength (org.batfish.representation.juniper.FwFromPacketLength)2 FwThenNextIp (org.batfish.representation.juniper.FwThenNextIp)2 PsThenNextHopIp (org.batfish.representation.juniper.PsThenNextHopIp)2 IpProtocol (org.batfish.datamodel.IpProtocol)1 FwFromDestinationAddress (org.batfish.representation.juniper.FwFromDestinationAddress)1 FwFromDestinationAddressExcept (org.batfish.representation.juniper.FwFromDestinationAddressExcept)1 FwFromDestinationPort (org.batfish.representation.juniper.FwFromDestinationPort)1 FwFromDestinationPrefixList (org.batfish.representation.juniper.FwFromDestinationPrefixList)1 FwFromDestinationPrefixListExcept (org.batfish.representation.juniper.FwFromDestinationPrefixListExcept)1 FwFromIcmpCode (org.batfish.representation.juniper.FwFromIcmpCode)1