Search in sources :

Example 1 with PsFromRouteFilter

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

the class ConfigurationBuilder method enterPopsf_route_filter.

@Override
public void enterPopsf_route_filter(Popsf_route_filterContext ctx) {
    _currentRouteFilter = _termRouteFilters.get(_currentPsTerm);
    if (_currentRouteFilter == null) {
        String rfName = _currentPolicyStatement.getName() + ":" + _currentPsTerm.getName();
        _currentRouteFilter = new RouteFilter(rfName);
        _termRouteFilters.put(_currentPsTerm, _currentRouteFilter);
        _configuration.getRouteFilters().put(rfName, _currentRouteFilter);
        PsFromRouteFilter from = new PsFromRouteFilter(rfName);
        _currentPsTerm.getFroms().add(from);
    }
    if (ctx.IP_PREFIX() != null) {
        _currentRouteFilterPrefix = Prefix.parse(ctx.IP_PREFIX().getText());
        _currentRouteFilter.setIpv4(true);
    } else if (ctx.IPV6_PREFIX() != null) {
        _currentRoute6FilterPrefix = new Prefix6(ctx.IPV6_PREFIX().getText());
        _currentRouteFilter.setIpv6(true);
    }
}
Also used : PsFromRouteFilter(org.batfish.representation.juniper.PsFromRouteFilter) PsFromRouteFilter(org.batfish.representation.juniper.PsFromRouteFilter) RouteFilter(org.batfish.representation.juniper.RouteFilter) Prefix6(org.batfish.datamodel.Prefix6)

Aggregations

Prefix6 (org.batfish.datamodel.Prefix6)1 PsFromRouteFilter (org.batfish.representation.juniper.PsFromRouteFilter)1 RouteFilter (org.batfish.representation.juniper.RouteFilter)1