use of org.batfish.datamodel.routing_policy.expr.NamedPrefix6Set in project batfish by batfish.
the class PsFromRouteFilter method toBooleanExpr.
@Override
public BooleanExpr toBooleanExpr(JuniperConfiguration jc, Configuration c, Warnings warnings) {
RouteFilterList rfl = c.getRouteFilterLists().get(_routeFilterName);
Route6FilterList rfl6 = c.getRoute6FilterLists().get(_routeFilterName);
BooleanExpr match4 = null;
BooleanExpr match6 = null;
if (rfl != null) {
match4 = new MatchPrefixSet(new DestinationNetwork(), new NamedPrefixSet(_routeFilterName));
}
if (rfl6 != null) {
match6 = new MatchPrefix6Set(new DestinationNetwork6(), new NamedPrefix6Set(_routeFilterName));
}
if (match4 != null && match6 == null) {
return match4;
} else if (rfl == null && rfl6 != null) {
return match6;
} else if (rfl != null && rfl6 != null) {
Disjunction d = new Disjunction();
d.getDisjuncts().add(match4);
d.getDisjuncts().add(match6);
return d;
} else {
throw new VendorConversionException("missing route filter list: \"" + _routeFilterName + "\"");
}
}
use of org.batfish.datamodel.routing_policy.expr.NamedPrefix6Set 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.NamedPrefix6Set 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();
}
Aggregations