Search in sources :

Example 1 with As_path_set_elemContext

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

the class CiscoControlPlaneExtractor method exitAs_path_set_stanza.

@Override
public void exitAs_path_set_stanza(As_path_set_stanzaContext ctx) {
    String name = ctx.name.getText();
    int definitionLine = ctx.name.getStart().getLine();
    AsPathSet asPathSet = _configuration.getAsPathSets().get(name);
    if (asPathSet != null) {
        _w.redFlag("Redeclaration of as-path-set: '" + name + "'");
    }
    asPathSet = new AsPathSet(name, definitionLine);
    _configuration.getAsPathSets().put(name, asPathSet);
    for (As_path_set_elemContext elemCtx : ctx.elems) {
        AsPathSetElem elem = toAsPathSetElem(elemCtx);
        asPathSet.getElements().add(elem);
    }
}
Also used : RegexAsPathSetElem(org.batfish.datamodel.routing_policy.expr.RegexAsPathSetElem) AsPathSetElem(org.batfish.datamodel.routing_policy.expr.AsPathSetElem) AsPathSet(org.batfish.representation.cisco.AsPathSet) NamedAsPathSet(org.batfish.datamodel.routing_policy.expr.NamedAsPathSet) ExplicitAsPathSet(org.batfish.datamodel.routing_policy.expr.ExplicitAsPathSet) VarAsPathSet(org.batfish.datamodel.routing_policy.expr.VarAsPathSet) As_path_set_elemContext(org.batfish.grammar.cisco.CiscoParser.As_path_set_elemContext)

Aggregations

AsPathSetElem (org.batfish.datamodel.routing_policy.expr.AsPathSetElem)1 ExplicitAsPathSet (org.batfish.datamodel.routing_policy.expr.ExplicitAsPathSet)1 NamedAsPathSet (org.batfish.datamodel.routing_policy.expr.NamedAsPathSet)1 RegexAsPathSetElem (org.batfish.datamodel.routing_policy.expr.RegexAsPathSetElem)1 VarAsPathSet (org.batfish.datamodel.routing_policy.expr.VarAsPathSet)1 As_path_set_elemContext (org.batfish.grammar.cisco.CiscoParser.As_path_set_elemContext)1 AsPathSet (org.batfish.representation.cisco.AsPathSet)1