Search in sources :

Example 1 with StandardAccessList

use of org.batfish.representation.cisco.StandardAccessList in project batfish by batfish.

the class CiscoControlPlaneExtractor method enterStandard_access_list_stanza.

@Override
public void enterStandard_access_list_stanza(Standard_access_list_stanzaContext ctx) {
    String name;
    int definitionLine;
    if (ctx.name != null) {
        name = ctx.name.getText();
        definitionLine = ctx.name.getStart().getLine();
    } else if (ctx.num != null) {
        name = ctx.num.getText();
        definitionLine = ctx.num.getLine();
    } else {
        throw new BatfishException("Invalid standard access-list name");
    }
    StandardAccessList list = _configuration.getStandardAcls().computeIfAbsent(name, n -> new StandardAccessList(n, definitionLine));
    _currentStandardAcl = list;
}
Also used : BatfishException(org.batfish.common.BatfishException) RedFlagBatfishException(org.batfish.common.RedFlagBatfishException) StandardAccessList(org.batfish.representation.cisco.StandardAccessList)

Aggregations

BatfishException (org.batfish.common.BatfishException)1 RedFlagBatfishException (org.batfish.common.RedFlagBatfishException)1 StandardAccessList (org.batfish.representation.cisco.StandardAccessList)1