use of org.batfish.representation.cisco.RouteMap in project batfish by batfish.
the class CiscoControlPlaneExtractor method enterRoute_map_stanza.
@Override
public void enterRoute_map_stanza(Route_map_stanzaContext ctx) {
String name = ctx.name.getText();
int definitionLine = ctx.name.getStart().getLine();
RouteMap routeMap = _configuration.getRouteMaps().computeIfAbsent(name, n -> new RouteMap(n, definitionLine));
_currentRouteMap = routeMap;
int num = toInteger(ctx.num);
LineAction action = toLineAction(ctx.rmt);
RouteMapClause clause = _currentRouteMap.getClauses().get(num);
if (clause == null) {
clause = new RouteMapClause(action, name, num);
routeMap.getClauses().put(num, clause);
} else {
_w.redFlag("Route map '" + _currentRouteMap.getName() + "' already contains clause numbered '" + num + "'. Duplicate clause will be merged with original clause.");
}
_currentRouteMapClause = clause;
}
Aggregations