Search in sources :

Example 1 with MacAccessList

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

the class CiscoControlPlaneExtractor method enterS_mac_access_list.

@Override
public void enterS_mac_access_list(S_mac_access_listContext ctx) {
    String name = ctx.num.getText();
    int line = ctx.num.getLine();
    MacAccessList list = _configuration.getMacAccessLists().computeIfAbsent(name, n -> new MacAccessList(n, line));
    _currentMacAccessList = list;
}
Also used : MacAccessList(org.batfish.representation.cisco.MacAccessList)

Example 2 with MacAccessList

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

the class CiscoControlPlaneExtractor method enterS_mac_access_list_extended.

@Override
public void enterS_mac_access_list_extended(S_mac_access_list_extendedContext ctx) {
    String name;
    int line;
    if (ctx.num != null) {
        name = ctx.num.getText();
        line = ctx.num.getLine();
    } else if (ctx.name != null) {
        name = ctx.name.getText();
        line = ctx.name.getStart().getLine();
    } else {
        throw new BatfishException("Could not determine name of extended mac access-list");
    }
    MacAccessList list = _configuration.getMacAccessLists().computeIfAbsent(name, n -> new MacAccessList(n, line));
    _currentMacAccessList = list;
}
Also used : BatfishException(org.batfish.common.BatfishException) RedFlagBatfishException(org.batfish.common.RedFlagBatfishException) MacAccessList(org.batfish.representation.cisco.MacAccessList)

Aggregations

MacAccessList (org.batfish.representation.cisco.MacAccessList)2 BatfishException (org.batfish.common.BatfishException)1 RedFlagBatfishException (org.batfish.common.RedFlagBatfishException)1