Search in sources :

Example 1 with ExtendedAccessList

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

the class CiscoControlPlaneExtractor method enterExtended_access_list_stanza.

@Override
public void enterExtended_access_list_stanza(Extended_access_list_stanzaContext ctx) {
    String name;
    int definitionLine;
    if (ctx.name != null) {
        name = ctx.name.getText();
        definitionLine = ctx.name.getStart().getLine();
    } else if (ctx.shortname != null) {
        name = ctx.shortname.getText();
        definitionLine = ctx.shortname.getStart().getLine();
    } else if (ctx.num != null) {
        name = ctx.num.getText();
        definitionLine = ctx.num.getLine();
    } else {
        throw new BatfishException("Could not determine acl name");
    }
    ExtendedAccessList list = _configuration.getExtendedAcls().computeIfAbsent(name, n -> new ExtendedAccessList(n, definitionLine));
    _currentExtendedAcl = list;
}
Also used : BatfishException(org.batfish.common.BatfishException) RedFlagBatfishException(org.batfish.common.RedFlagBatfishException) ExtendedAccessList(org.batfish.representation.cisco.ExtendedAccessList)

Aggregations

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