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();
}
Aggregations