use of org.batfish.datamodel.routing_policy.expr.Disjunction in project batfish by batfish.
the class RouteMapMatchIpPrefixListLine 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) {
PrefixList list = cc.getPrefixLists().get(listName);
if (list != null) {
list.getReferers().put(this, "route-map match prefix-list");
disjuncts.add(new MatchPrefixSet(new DestinationNetwork(), new NamedPrefixSet(listName)));
} else {
cc.undefined(CiscoStructureType.PREFIX_LIST, listName, CiscoStructureUsage.ROUTE_MAP_MATCH_IP_PREFIX_LIST, _statementLine);
}
}
return d.simplify();
}
use of org.batfish.datamodel.routing_policy.expr.Disjunction in project batfish by batfish.
the class RouteMapMatchIpv6AccessListLine 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;
Ip6AccessList ipAccessList = null;
Route6FilterList routeFilterList = null;
if (_routing) {
routeFilterList = c.getRoute6FilterLists().get(listName);
list = routeFilterList;
} else {
ipAccessList = c.getIp6AccessLists().get(listName);
list = ipAccessList;
}
if (list == null) {
cc.undefined(CiscoStructureType.IPV6_ACCESS_LIST, listName, CiscoStructureUsage.ROUTE_MAP_MATCH_IPV6_ACCESS_LIST, _statementLine);
} else {
String msg = "route-map match ipv6 access-list line";
ExtendedIpv6AccessList extendedAccessList = cc.getExtendedIpv6Acls().get(listName);
if (extendedAccessList != null) {
extendedAccessList.getReferers().put(this, msg);
}
StandardIpv6AccessList standardAccessList = cc.getStandardIpv6Acls().get(listName);
if (standardAccessList != null) {
standardAccessList.getReferers().put(this, msg);
}
if (_routing) {
disjuncts.add(new MatchPrefix6Set(new DestinationNetwork6(), new NamedPrefix6Set(listName)));
} else {
disjuncts.add(new MatchIp6AccessList(listName));
}
}
}
return d.simplify();
}
use of org.batfish.datamodel.routing_policy.expr.Disjunction in project batfish by batfish.
the class RouteMapMatchIpv6PrefixListLine 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) {
Prefix6List list = cc.getPrefix6Lists().get(listName);
if (list != null) {
list.getReferers().put(this, "route-map match prefix-list");
disjuncts.add(new MatchPrefix6Set(new DestinationNetwork6(), new NamedPrefix6Set(listName)));
} else {
cc.undefined(CiscoStructureType.PREFIX6_LIST, listName, CiscoStructureUsage.ROUTE_MAP_MATCH_IPV6_PREFIX_LIST, _statementLine);
}
}
return d.simplify();
}
use of org.batfish.datamodel.routing_policy.expr.Disjunction in project batfish by batfish.
the class RouteMapMatchProtocolLine method toBooleanExpr.
@Override
public BooleanExpr toBooleanExpr(Configuration c, CiscoConfiguration cc, Warnings w) {
Disjunction d = new Disjunction();
List<BooleanExpr> disjuncts = d.getDisjuncts();
for (String protocol : _protocols) {
disjuncts.add(new MatchProtocol(RoutingProtocol.fromProtocolName(protocol)));
}
return d.simplify();
}
use of org.batfish.datamodel.routing_policy.expr.Disjunction 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