use of org.batfish.datamodel.vendor_family.cisco.AaaAccountingCommands in project batfish by batfish.
the class CiscoControlPlaneExtractor method enterAaa_accounting_commands_line.
@Override
public void enterAaa_accounting_commands_line(Aaa_accounting_commands_lineContext ctx) {
Map<String, AaaAccountingCommands> commands = _configuration.getCf().getAaa().getAccounting().getCommands();
Set<String> levels = new TreeSet<>();
if (ctx.levels != null) {
List<SubRange> range = toRange(ctx.levels);
for (SubRange subRange : range) {
for (int i = subRange.getStart(); i <= subRange.getEnd(); i++) {
String level = Integer.toString(i);
levels.add(level);
}
}
} else {
levels.add(AaaAccounting.DEFAULT_COMMANDS);
}
List<AaaAccountingCommands> currentAaaAccountingCommands = new ArrayList<>();
for (String level : levels) {
AaaAccountingCommands c = commands.computeIfAbsent(level, k -> new AaaAccountingCommands());
currentAaaAccountingCommands.add(c);
}
_currentAaaAccountingCommands = currentAaaAccountingCommands;
}
Aggregations