@Test public void testInitLocalRib() { VirtualRouter vr = makeIosVirtualRouter(null); addInterfaces(vr.getConfiguration(), exampleInterfaceAddresses); vr.initRibs(); vr.initLocalRib(); assertThat( vr._localRib.getTypedRoutes(), equalTo( exampleInterfaceAddresses.entrySet().stream() .filter(e -> e.getValue().getPrefix().getPrefixLength() < Prefix.MAX_PREFIX_LENGTH) .map( e -> new AnnotatedRoute<>( new LocalRoute(e.getValue(), e.getKey()), DEFAULT_VRF_NAME)) .collect(ImmutableSet.toImmutableSet()))); }
@VisibleForTesting void initLocalRib() { _c.getActiveInterfaces(_name).values().stream() .flatMap(VirtualRouter::generateLocalRoutes) .forEach(r -> _localRib.mergeRoute(annotateRoute(r))); }
VirtualRouter { @VisibleForTesting void initLocalRib() { _c.getActiveInterfaces(_name).values().stream() .flatMap(VirtualRouter::generateLocalRoutes) .forEach(r -> _localRib.mergeRoute(annotateRoute(r))); } }
VirtualRouter { @VisibleForTesting void initLocalRib() { _c.getActiveInterfaces(_name).values().stream() .flatMap(VirtualRouter::generateLocalRoutes) .forEach(r -> _localRib.mergeRoute(annotateRoute(r))); } VirtualRouter(@Nonnull String name, @Nonnull Node node); }
VirtualRouter { @VisibleForTesting void initLocalRib() { _c.getActiveInterfaces(_name).values().stream() .flatMap(VirtualRouter::generateLocalRoutes) .forEach(r -> _localRib.mergeRoute(annotateRoute(r))); } 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 void initLocalRib() { _c.getActiveInterfaces(_name).values().stream() .flatMap(VirtualRouter::generateLocalRoutes) .forEach(r -> _localRib.mergeRoute(annotateRoute(r))); } 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();  }