Search in sources :

Example 1 with MatchIpAccessList

use of org.batfish.datamodel.routing_policy.expr.MatchIpAccessList in project batfish by batfish.

the class RouteMapMatchIpAccessListLine method toBooleanExpr.

@Override
public BooleanExpr toBooleanExpr(Configuration c, CiscoConfiguration cc, Warnings w) {
    Disjunction d = new Disjunction();
    List<BooleanExpr> disjuncts = d.getDisjuncts();
    for (String listName : _listNames) {
        Object list;
        IpAccessList ipAccessList = null;
        RouteFilterList routeFilterList = null;
        if (_routing) {
            routeFilterList = c.getRouteFilterLists().get(listName);
            list = routeFilterList;
        } else {
            ipAccessList = c.getIpAccessLists().get(listName);
            list = ipAccessList;
        }
        if (list == null) {
            cc.undefined(CiscoStructureType.IP_ACCESS_LIST, listName, CiscoStructureUsage.ROUTE_MAP_MATCH_IP_ACCESS_LIST, _statementLine);
        } else {
            String msg = "route-map match ip access-list line";
            ExtendedAccessList extendedAccessList = cc.getExtendedAcls().get(listName);
            if (extendedAccessList != null) {
                extendedAccessList.getReferers().put(this, msg);
            }
            StandardAccessList standardAccessList = cc.getStandardAcls().get(listName);
            if (standardAccessList != null) {
                standardAccessList.getReferers().put(this, msg);
            }
            if (_routing) {
                disjuncts.add(new MatchPrefixSet(new DestinationNetwork(), new NamedPrefixSet(listName)));
            } else {
                disjuncts.add(new MatchIpAccessList(listName));
            }
        }
    }
    return d.simplify();
}
Also used : NamedPrefixSet(org.batfish.datamodel.routing_policy.expr.NamedPrefixSet) MatchPrefixSet(org.batfish.datamodel.routing_policy.expr.MatchPrefixSet) Disjunction(org.batfish.datamodel.routing_policy.expr.Disjunction) DestinationNetwork(org.batfish.datamodel.routing_policy.expr.DestinationNetwork) RouteFilterList(org.batfish.datamodel.RouteFilterList) MatchIpAccessList(org.batfish.datamodel.routing_policy.expr.MatchIpAccessList) MatchIpAccessList(org.batfish.datamodel.routing_policy.expr.MatchIpAccessList) IpAccessList(org.batfish.datamodel.IpAccessList) BooleanExpr(org.batfish.datamodel.routing_policy.expr.BooleanExpr)

Aggregations

IpAccessList (org.batfish.datamodel.IpAccessList)1 RouteFilterList (org.batfish.datamodel.RouteFilterList)1 BooleanExpr (org.batfish.datamodel.routing_policy.expr.BooleanExpr)1 DestinationNetwork (org.batfish.datamodel.routing_policy.expr.DestinationNetwork)1 Disjunction (org.batfish.datamodel.routing_policy.expr.Disjunction)1 MatchIpAccessList (org.batfish.datamodel.routing_policy.expr.MatchIpAccessList)1 MatchPrefixSet (org.batfish.datamodel.routing_policy.expr.MatchPrefixSet)1 NamedPrefixSet (org.batfish.datamodel.routing_policy.expr.NamedPrefixSet)1