@Test public void testAlwaysGenerateLocalRoutes() { assertFalse(shouldGenerateLocalRoute(Prefix.MAX_PREFIX_LENGTH, null)); assertFalse( shouldGenerateLocalRoute( Prefix.MAX_PREFIX_LENGTH, ConnectedRouteMetadata.builder().build())); assertTrue( shouldGenerateLocalRoute( Prefix.MAX_PREFIX_LENGTH, ConnectedRouteMetadata.builder().setGenerateLocalRoutes(true).build())); assertTrue(shouldGenerateLocalRoute(24, null)); assertTrue(shouldGenerateLocalRoute(24, ConnectedRouteMetadata.builder().build())); assertTrue( shouldGenerateLocalRoute( 24, ConnectedRouteMetadata.builder().setGenerateLocalRoutes(true).build())); }
@VisibleForTesting static boolean shouldGenerateLocalRoute( int prefixLength, @Nullable ConnectedRouteMetadata connectedRouteMetadata) { return (connectedRouteMetadata != null && Boolean.TRUE.equals(connectedRouteMetadata.getGenerateLocalRoutes())) || prefixLength < Prefix.MAX_PREFIX_LENGTH; }
VirtualRouter { @VisibleForTesting static boolean shouldGenerateLocalRoute( int prefixLength, @Nullable ConnectedRouteMetadata connectedRouteMetadata) { return (connectedRouteMetadata != null && Boolean.TRUE.equals(connectedRouteMetadata.getGenerateLocalRoutes())) || prefixLength < Prefix.MAX_PREFIX_LENGTH; } }
VirtualRouter { @VisibleForTesting static boolean shouldGenerateLocalRoute( int prefixLength, @Nullable ConnectedRouteMetadata connectedRouteMetadata) { return (connectedRouteMetadata != null && Boolean.TRUE.equals(connectedRouteMetadata.getGenerateLocalRoutes())) || prefixLength < Prefix.MAX_PREFIX_LENGTH; } VirtualRouter(@Nonnull String name, @Nonnull Node node); }
VirtualRouter { @VisibleForTesting static boolean shouldGenerateLocalRoute( int prefixLength, @Nullable ConnectedRouteMetadata connectedRouteMetadata) { return (connectedRouteMetadata != null && Boolean.TRUE.equals(connectedRouteMetadata.getGenerateLocalRoutes())) || prefixLength < Prefix.MAX_PREFIX_LENGTH; } VirtualRouter(@Nonnull String name, @Nonnull Node node); void computeFib(); Configuration getConfiguration(); Fib getFib(); void enqueueCrossVrfRoutes(
      @Nonnull CrossVrfEdgeId remoteVrfToOurRib,
      @Nonnull Stream<RouteAdvertisement<AnnotatedRoute<AbstractRoute>>> routeAdverts,
      @Nullable String policyName); Map<String, OspfRoutingProcess> getOspfProcesses(); Set<Layer2Vni> getLayer2Vnis(); Set<Layer3Vni> getLayer3Vnis(); @Nonnull String getName(); }
VirtualRouter { @VisibleForTesting static boolean shouldGenerateLocalRoute( int prefixLength, @Nullable ConnectedRouteMetadata connectedRouteMetadata) { return (connectedRouteMetadata != null && Boolean.TRUE.equals(connectedRouteMetadata.getGenerateLocalRoutes())) || prefixLength < Prefix.MAX_PREFIX_LENGTH; } VirtualRouter(@Nonnull String name, @Nonnull Node node); void computeFib(); Configuration getConfiguration(); Fib getFib(); void enqueueCrossVrfRoutes(
      @Nonnull CrossVrfEdgeId remoteVrfToOurRib,
      @Nonnull Stream<RouteAdvertisement<AnnotatedRoute<AbstractRoute>>> routeAdverts,
      @Nullable String policyName); Map<String, OspfRoutingProcess> getOspfProcesses(); Set<Layer2Vni> getLayer2Vnis(); Set<Layer3Vni> getLayer3Vnis(); @Nonnull String getName();  }