Search in sources :

Example 6 with NamedCommunitySet

use of org.batfish.datamodel.routing_policy.expr.NamedCommunitySet in project batfish by batfish.

the class PsThenCommunityDelete method applyTo.

@Override
public void applyTo(List<Statement> statements, JuniperConfiguration juniperVendorConfiguration, Configuration c, Warnings warnings) {
    CommunityList namedList = _configuration.getCommunityLists().get(_name);
    if (namedList == null) {
        warnings.redFlag("Reference to undefined community: \"" + _name + "\"");
    } else {
        org.batfish.datamodel.CommunityList list = c.getCommunityLists().get(_name);
        if (list == null) {
            throw new VendorConversionException("missing community list: \"" + _name + "\"");
        }
        statements.add(new DeleteCommunity(new NamedCommunitySet(_name)));
    }
}
Also used : VendorConversionException(org.batfish.common.VendorConversionException) NamedCommunitySet(org.batfish.datamodel.routing_policy.expr.NamedCommunitySet) DeleteCommunity(org.batfish.datamodel.routing_policy.statement.DeleteCommunity)

Aggregations

NamedCommunitySet (org.batfish.datamodel.routing_policy.expr.NamedCommunitySet)6 CommunityList (org.batfish.datamodel.CommunityList)5 BatfishException (org.batfish.common.BatfishException)3 InlineCommunitySet (org.batfish.datamodel.routing_policy.expr.InlineCommunitySet)3 DeleteCommunity (org.batfish.datamodel.routing_policy.statement.DeleteCommunity)2 CommunityVar (org.batfish.symbolic.CommunityVar)2 BoolExpr (com.microsoft.z3.BoolExpr)1 HashSet (java.util.HashSet)1 BDD (net.sf.javabdd.BDD)1 VendorConversionException (org.batfish.common.VendorConversionException)1 CommunityListLine (org.batfish.datamodel.CommunityListLine)1 BooleanExpr (org.batfish.datamodel.routing_policy.expr.BooleanExpr)1 CommunitySetElem (org.batfish.datamodel.routing_policy.expr.CommunitySetElem)1 Disjunction (org.batfish.datamodel.routing_policy.expr.Disjunction)1 LiteralCommunitySetElemHalf (org.batfish.datamodel.routing_policy.expr.LiteralCommunitySetElemHalf)1 MatchCommunitySet (org.batfish.datamodel.routing_policy.expr.MatchCommunitySet)1