@Override protected RoutingProtocol featureValueOf(AbstractRoute actual) { return actual.getProtocol(); } }
@Override public Result evaluate(Environment environment) { Result result = new Result(); // Workaround: Treat ISIS_ANY as a special value if (_protocol == RoutingProtocol.ISIS_ANY) { result.setBooleanValue(ISIS_EXPANSION.contains(environment.getOriginalRoute().getProtocol())); } else { result.setBooleanValue(environment.getOriginalRoute().getProtocol().equals(_protocol)); } return result; }
route -> (network == null || network.equals(route.getNetwork())) && protocolSpec.getProtocols().contains(route.getProtocol())) .forEach( route ->
route -> (network == null || network.equals(route.getNetwork())) && protocolSpec.getProtocols().contains(route.getProtocol())) .forEach( route -> new RouteRowSecondaryKey( route.getNextHopIp(), route.getProtocol().protocolName()), k -> new TreeSet<>()) .add(
_dataPlane.getRibs().get(currentNodeName).get(vrfName).longestPrefixMatch(dstIp).stream() .sorted() .map(rc -> new RouteInfo(rc.getProtocol(), rc.getNetwork(), rc.getNextHopIp())) .distinct() .collect(ImmutableList.toImmutableList());
/** * Converts a {@link AbstractRoute} to a {@link Row} * * @param hostName {@link String} host-name of the node containing the route * @param vrfName {@link String} name of the VRF containing the route * @param abstractRoute {@link AbstractRoute} to convert * @param columnMetadataMap Column metadata of the columns for this {@link Row} c * @return {@link Row} representing the {@link AbstractRoute} */ private static Row abstractRouteToRow( String hostName, String vrfName, AbstractRoute abstractRoute, Map<String, ColumnMetadata> columnMetadataMap, @Nullable Map<Ip, Set<String>> ipOwners) { return Row.builder(columnMetadataMap) .put(COL_NODE, new Node(hostName)) .put(COL_VRF_NAME, vrfName) .put(COL_NETWORK, abstractRoute.getNetwork()) .put(COL_NEXT_HOP_IP, abstractRoute.getNextHopIp()) .put(COL_NEXT_HOP, computeNextHopNode(abstractRoute.getNextHopIp(), ipOwners)) .put(COL_PROTOCOL, abstractRoute.getProtocol()) .put( COL_TAG, abstractRoute.getTag() == AbstractRoute.NO_TAG ? null : abstractRoute.getTag()) .put(COL_ADMIN_DISTANCE, abstractRoute.getAdministrativeCost()) .put(COL_METRIC, abstractRoute.getMetric()) .build(); }
RoutingProtocol remoteRouteProtocol = route.getProtocol(); transformedOutgoingRouteBuilder.setSrcProtocol(route.getProtocol()); return transformedOutgoingRouteBuilder;