use of org.batfish.datamodel.RouteFilterList 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();
}
use of org.batfish.datamodel.RouteFilterList in project batfish by batfish.
the class FwFromPrefixList method applyTo.
@Override
public void applyTo(IpAccessListLine line, JuniperConfiguration jc, Warnings w, Configuration c) {
PrefixList pl = jc.getPrefixLists().get(_name);
if (pl != null) {
pl.getReferers().put(this, "firewall from source-prefix-list");
if (pl.getIpv6()) {
return;
}
RouteFilterList sourcePrefixList = c.getRouteFilterLists().get(_name);
List<IpWildcard> wildcards = sourcePrefixList.getMatchingIps();
line.setSrcOrDstIps(Iterables.concat(line.getSrcOrDstIps(), wildcards));
} else {
w.redFlag("Reference to undefined source prefix-list: \"" + _name + "\"");
}
}
use of org.batfish.datamodel.RouteFilterList in project batfish by batfish.
the class FwFromSourcePrefixListExcept method applyTo.
@Override
public void applyTo(IpAccessListLine line, JuniperConfiguration jc, Warnings w, Configuration c) {
PrefixList pl = jc.getPrefixLists().get(_name);
if (pl != null) {
pl.getReferers().put(this, "firewall from source-prefix-list except");
if (pl.getIpv6()) {
return;
}
RouteFilterList sourcePrefixList = c.getRouteFilterLists().get(_name);
List<IpWildcard> wildcards = sourcePrefixList.getMatchingIps();
line.setNotSrcIps(Iterables.concat(line.getNotSrcIps(), wildcards));
} else {
w.redFlag("Reference to undefined source prefix-list: \"" + _name + "\"");
}
}
use of org.batfish.datamodel.RouteFilterList in project batfish by batfish.
the class FwFromDestinationPrefixList method applyTo.
@Override
public void applyTo(IpAccessListLine line, JuniperConfiguration jc, Warnings w, Configuration c) {
PrefixList pl = jc.getPrefixLists().get(_name);
if (pl != null) {
pl.getReferers().put(this, "firewall from destination-prefix-list");
if (pl.getIpv6()) {
return;
}
RouteFilterList destinationPrefixList = c.getRouteFilterLists().get(_name);
List<IpWildcard> wildcards = destinationPrefixList.getMatchingIps();
line.setDstIps(Iterables.concat(line.getDstIps(), wildcards));
} else {
w.redFlag("Reference to undefined source prefix-list: \"" + _name + "\"");
}
}
use of org.batfish.datamodel.RouteFilterList in project batfish by batfish.
the class VyosConfiguration method convertPrefixLists.
private void convertPrefixLists() {
for (Entry<String, PrefixList> e : _prefixLists.entrySet()) {
String name = e.getKey();
PrefixList prefixList = e.getValue();
RouteFilterList routeFilterList = toRouteFilterList(prefixList);
_c.getRouteFilterLists().put(name, routeFilterList);
}
}
Aggregations