use of org.batfish.representation.cisco.CiscoStructureUsage in project batfish by batfish.
the class CiscoControlPlaneExtractor method exitL_access_class.
@Override
public void exitL_access_class(L_access_classContext ctx) {
boolean ipv6 = (ctx.IPV6() != null);
String name = ctx.name.getText();
int nameLine = ctx.name.getStart().getLine();
BiConsumer<Line, String> setter;
CiscoStructureType structureType;
CiscoStructureUsage structureUsage;
if (ctx.OUT() != null || ctx.EGRESS() != null) {
if (ipv6) {
setter = Line::setOutputIpv6AccessList;
structureType = CiscoStructureType.IPV6_ACCESS_LIST;
structureUsage = CiscoStructureUsage.LINE_ACCESS_CLASS_LIST6;
_configuration.getLineIpv6AccessClassLists().add(name);
} else {
setter = Line::setOutputAccessList;
structureType = CiscoStructureType.IP_ACCESS_LIST;
structureUsage = CiscoStructureUsage.LINE_ACCESS_CLASS_LIST;
_configuration.getLineAccessClassLists().add(name);
}
} else {
if (ipv6) {
setter = Line::setInputIpv6AccessList;
structureType = CiscoStructureType.IPV6_ACCESS_LIST;
structureUsage = CiscoStructureUsage.LINE_ACCESS_CLASS_LIST6;
_configuration.getLineIpv6AccessClassLists().add(name);
} else {
setter = Line::setInputAccessList;
structureType = CiscoStructureType.IP_ACCESS_LIST;
structureUsage = CiscoStructureUsage.LINE_ACCESS_CLASS_LIST;
_configuration.getLineAccessClassLists().add(name);
}
}
_configuration.referenceStructure(structureType, name, structureUsage, nameLine);
for (String currentName : _currentLineNames) {
Line line = _configuration.getCf().getLines().get(currentName);
setter.accept(line, name);
}
}
Aggregations