Search in sources :

Example 1 with VariableContext

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

the class CiscoControlPlaneExtractor method exitSet_community_list_additive_rm_stanza.

@Override
public void exitSet_community_list_additive_rm_stanza(Set_community_list_additive_rm_stanzaContext ctx) {
    int statementLine = ctx.getStart().getLine();
    Set<String> communityLists = new LinkedHashSet<>();
    for (VariableContext communityListCtx : ctx.comm_lists) {
        String communityList = communityListCtx.getText();
        communityLists.add(communityList);
    }
    RouteMapSetAdditiveCommunityListLine line = new RouteMapSetAdditiveCommunityListLine(communityLists, statementLine);
    _currentRouteMapClause.addSetLine(line);
}
Also used : LinkedHashSet(java.util.LinkedHashSet) RouteMapSetAdditiveCommunityListLine(org.batfish.representation.cisco.RouteMapSetAdditiveCommunityListLine) VariableContext(org.batfish.grammar.cisco.CiscoParser.VariableContext)

Example 2 with VariableContext

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

the class CiscoControlPlaneExtractor method exitMatch_as_path_access_list_rm_stanza.

@Override
public void exitMatch_as_path_access_list_rm_stanza(Match_as_path_access_list_rm_stanzaContext ctx) {
    int statementLine = ctx.getStart().getLine();
    Set<String> names = new TreeSet<>();
    for (VariableContext name : ctx.name_list) {
        names.add(name.getText());
    }
    RouteMapMatchAsPathAccessListLine line = new RouteMapMatchAsPathAccessListLine(names, statementLine);
    _currentRouteMapClause.addMatchLine(line);
}
Also used : RouteMapMatchAsPathAccessListLine(org.batfish.representation.cisco.RouteMapMatchAsPathAccessListLine) TreeSet(java.util.TreeSet) VariableContext(org.batfish.grammar.cisco.CiscoParser.VariableContext)

Example 3 with VariableContext

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

the class CiscoControlPlaneExtractor method exitMatch_ip_prefix_list_rm_stanza.

@Override
public void exitMatch_ip_prefix_list_rm_stanza(Match_ip_prefix_list_rm_stanzaContext ctx) {
    int statementLine = ctx.getStart().getLine();
    Set<String> names = new TreeSet<>();
    for (VariableContext t : ctx.name_list) {
        names.add(t.getText());
    }
    RouteMapMatchIpPrefixListLine line = new RouteMapMatchIpPrefixListLine(names, statementLine);
    _currentRouteMapClause.addMatchLine(line);
}
Also used : TreeSet(java.util.TreeSet) RouteMapMatchIpPrefixListLine(org.batfish.representation.cisco.RouteMapMatchIpPrefixListLine) VariableContext(org.batfish.grammar.cisco.CiscoParser.VariableContext)

Example 4 with VariableContext

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

the class CiscoControlPlaneExtractor method exitMatch_ipv6_prefix_list_rm_stanza.

@Override
public void exitMatch_ipv6_prefix_list_rm_stanza(Match_ipv6_prefix_list_rm_stanzaContext ctx) {
    int statementLine = ctx.getStart().getLine();
    Set<String> names = new TreeSet<>();
    for (VariableContext t : ctx.name_list) {
        names.add(t.getText());
    }
    RouteMapMatchIpv6PrefixListLine line = new RouteMapMatchIpv6PrefixListLine(names, statementLine);
    _currentRouteMapClause.addMatchLine(line);
}
Also used : RouteMapMatchIpv6PrefixListLine(org.batfish.representation.cisco.RouteMapMatchIpv6PrefixListLine) TreeSet(java.util.TreeSet) VariableContext(org.batfish.grammar.cisco.CiscoParser.VariableContext)

Example 5 with VariableContext

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

the class CiscoControlPlaneExtractor method exitSet_community_list_rm_stanza.

@Override
public void exitSet_community_list_rm_stanza(Set_community_list_rm_stanzaContext ctx) {
    Set<String> communityLists = new LinkedHashSet<>();
    int statementLine = ctx.getStart().getLine();
    for (VariableContext communityListCtx : ctx.comm_lists) {
        String communityList = communityListCtx.getText();
        communityLists.add(communityList);
    }
    RouteMapSetCommunityListLine line = new RouteMapSetCommunityListLine(communityLists, statementLine);
    _currentRouteMapClause.addSetLine(line);
}
Also used : LinkedHashSet(java.util.LinkedHashSet) RouteMapSetCommunityListLine(org.batfish.representation.cisco.RouteMapSetCommunityListLine) VariableContext(org.batfish.grammar.cisco.CiscoParser.VariableContext)

Aggregations

VariableContext (org.batfish.grammar.cisco.CiscoParser.VariableContext)6 TreeSet (java.util.TreeSet)4 LinkedHashSet (java.util.LinkedHashSet)2 RouteMapMatchAsPathAccessListLine (org.batfish.representation.cisco.RouteMapMatchAsPathAccessListLine)1 RouteMapMatchCommunityListLine (org.batfish.representation.cisco.RouteMapMatchCommunityListLine)1 RouteMapMatchIpPrefixListLine (org.batfish.representation.cisco.RouteMapMatchIpPrefixListLine)1 RouteMapMatchIpv6PrefixListLine (org.batfish.representation.cisco.RouteMapMatchIpv6PrefixListLine)1 RouteMapSetAdditiveCommunityListLine (org.batfish.representation.cisco.RouteMapSetAdditiveCommunityListLine)1 RouteMapSetCommunityListLine (org.batfish.representation.cisco.RouteMapSetCommunityListLine)1