use of org.batfish.datamodel.routing_policy.expr.NamedAsPathSet in project batfish by batfish.
the class RoutePolicyBooleanAsPathIn method toBooleanExpr.
@Override
public BooleanExpr toBooleanExpr(CiscoConfiguration cc, Configuration c, Warnings w) {
if (_asExpr instanceof NamedAsPathSet) {
NamedAsPathSet named = (NamedAsPathSet) _asExpr;
String name = named.getName();
AsPathSet asPathSet = cc.getAsPathSets().get(name);
if (asPathSet == null) {
cc.undefined(CiscoStructureType.AS_PATH_SET, name, CiscoStructureUsage.ROUTE_POLICY_AS_PATH_IN, _expressionLine);
return BooleanExprs.False.toStaticBooleanExpr();
} else {
asPathSet.getReferers().put(this, "as-path in");
}
}
MatchAsPath match = new MatchAsPath(_asExpr);
return match;
}
use of org.batfish.datamodel.routing_policy.expr.NamedAsPathSet in project batfish by batfish.
the class RouteMapMatchAsPathAccessListLine 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) {
IpAsPathAccessList list = cc.getAsPathAccessLists().get(listName);
if (list != null) {
list.getReferers().put(this, "route-map match ip as-path access-list");
disjuncts.add(new MatchAsPath(new NamedAsPathSet(listName)));
} else {
cc.undefined(CiscoStructureType.AS_PATH_ACCESS_LIST, listName, CiscoStructureUsage.ROUTE_MAP_MATCH_AS_PATH_ACCESS_LIST, _statementLine);
}
}
return d.simplify();
}
Aggregations