Search in sources :

Example 1 with FwFromDestinationPort

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

the class ConfigurationBuilder method exitFftf_destination_port.

@Override
public void exitFftf_destination_port(Fftf_destination_portContext ctx) {
    if (ctx.port() != null) {
        int port = getPortNumber(ctx.port());
        SubRange subrange = new SubRange(port, port);
        FwFrom from = new FwFromDestinationPort(subrange);
        _currentFwTerm.getFroms().add(from);
    } else if (ctx.range() != null) {
        for (SubrangeContext subrangeContext : ctx.range().range_list) {
            SubRange subrange = toSubRange(subrangeContext);
            FwFrom from = new FwFromDestinationPort(subrange);
            _currentFwTerm.getFroms().add(from);
        }
    }
}
Also used : FwFromDestinationPort(org.batfish.representation.juniper.FwFromDestinationPort) SubrangeContext(org.batfish.grammar.flatjuniper.FlatJuniperParser.SubrangeContext) FwFrom(org.batfish.representation.juniper.FwFrom) SubRange(org.batfish.datamodel.SubRange)

Aggregations

SubRange (org.batfish.datamodel.SubRange)1 SubrangeContext (org.batfish.grammar.flatjuniper.FlatJuniperParser.SubrangeContext)1 FwFrom (org.batfish.representation.juniper.FwFrom)1 FwFromDestinationPort (org.batfish.representation.juniper.FwFromDestinationPort)1