Search in sources :

Example 1 with CommunityContext

use of org.batfish.grammar.cisco.CiscoParser.CommunityContext in project batfish by batfish.

the class CiscoControlPlaneExtractor method exitSet_community_rm_stanza.

@Override
public void exitSet_community_rm_stanza(Set_community_rm_stanzaContext ctx) {
    List<Long> commList = new ArrayList<>();
    for (CommunityContext c : ctx.communities) {
        long community = toLong(c);
        commList.add(community);
    }
    RouteMapSetCommunityLine line = new RouteMapSetCommunityLine(commList);
    _currentRouteMapClause.addSetLine(line);
}
Also used : LiteralLong(org.batfish.datamodel.routing_policy.expr.LiteralLong) VarLong(org.batfish.datamodel.routing_policy.expr.VarLong) ArrayList(java.util.ArrayList) RouteMapSetCommunityLine(org.batfish.representation.cisco.RouteMapSetCommunityLine) CommunityContext(org.batfish.grammar.cisco.CiscoParser.CommunityContext)

Example 2 with CommunityContext

use of org.batfish.grammar.cisco.CiscoParser.CommunityContext in project batfish by batfish.

the class CiscoControlPlaneExtractor method exitIp_community_list_standard_tail.

@Override
public void exitIp_community_list_standard_tail(Ip_community_list_standard_tailContext ctx) {
    LineAction action = toLineAction(ctx.ala);
    List<Long> communities = new ArrayList<>();
    for (CommunityContext communityCtx : ctx.communities) {
        long community = toLong(communityCtx);
        communities.add(community);
    }
    StandardCommunityListLine line = new StandardCommunityListLine(action, communities);
    _currentStandardCommunityList.getLines().add(line);
}
Also used : LineAction(org.batfish.datamodel.LineAction) StandardCommunityListLine(org.batfish.representation.cisco.StandardCommunityListLine) LiteralLong(org.batfish.datamodel.routing_policy.expr.LiteralLong) VarLong(org.batfish.datamodel.routing_policy.expr.VarLong) ArrayList(java.util.ArrayList) CommunityContext(org.batfish.grammar.cisco.CiscoParser.CommunityContext)

Example 3 with CommunityContext

use of org.batfish.grammar.cisco.CiscoParser.CommunityContext in project batfish by batfish.

the class CiscoControlPlaneExtractor method exitSet_community_additive_rm_stanza.

@Override
public void exitSet_community_additive_rm_stanza(Set_community_additive_rm_stanzaContext ctx) {
    List<Long> commList = new ArrayList<>();
    for (CommunityContext c : ctx.communities) {
        long community = toLong(c);
        commList.add(community);
    }
    RouteMapSetAdditiveCommunityLine line = new RouteMapSetAdditiveCommunityLine(commList);
    _currentRouteMapClause.addSetLine(line);
}
Also used : LiteralLong(org.batfish.datamodel.routing_policy.expr.LiteralLong) VarLong(org.batfish.datamodel.routing_policy.expr.VarLong) ArrayList(java.util.ArrayList) CommunityContext(org.batfish.grammar.cisco.CiscoParser.CommunityContext) RouteMapSetAdditiveCommunityLine(org.batfish.representation.cisco.RouteMapSetAdditiveCommunityLine)

Aggregations

ArrayList (java.util.ArrayList)3 LiteralLong (org.batfish.datamodel.routing_policy.expr.LiteralLong)3 VarLong (org.batfish.datamodel.routing_policy.expr.VarLong)3 CommunityContext (org.batfish.grammar.cisco.CiscoParser.CommunityContext)3 LineAction (org.batfish.datamodel.LineAction)1 RouteMapSetAdditiveCommunityLine (org.batfish.representation.cisco.RouteMapSetAdditiveCommunityLine)1 RouteMapSetCommunityLine (org.batfish.representation.cisco.RouteMapSetCommunityLine)1 StandardCommunityListLine (org.batfish.representation.cisco.StandardCommunityListLine)1