@Test public void testInitializeRoutesByArea() { RibDelta<OspfIntraAreaRoute> delta = _routingProcess.initializeRoutesByArea(AREA0_CONFIG); assertTrue(delta.getActions().allMatch(r -> r.getReason() == ADD)); assertThat( delta.getRoutesStream().collect(Collectors.toList()), containsInAnyOrder( hasPrefix(PASSIVE_ADDR.getPrefix()), hasPrefix(ACTIVE_ADDR_1.getPrefix()), hasPrefix(ACTIVE_ADDR_2.getPrefix()))); }
@Nonnull @VisibleForTesting RibDelta<OspfIntraAreaRoute> initializeRoutesByArea(OspfArea area) { RibDelta.Builder<OspfIntraAreaRoute> deltaBuilder = RibDelta.builder(); for (String ifaceName : area.getInterfaces()) { Interface iface = _c.getAllInterfaces().get(ifaceName); if (iface == null || !iface.getActive() || !iface.getOspfEnabled()) { continue; } Set<OspfIntraAreaRoute> allRoutes = getIfaceAddressesForIntraAreaRoutes(iface) .map( ifaceAddr -> computeIntraAreaRouteFromInterface(area.getAreaNumber(), iface, ifaceAddr)) .collect(ImmutableSet.toImmutableSet()); allRoutes.forEach(r -> deltaBuilder.from(_intraAreaRib.mergeRouteGetDelta(r))); } return deltaBuilder.build(); }
OspfRoutingProcess implements RoutingProcess<OspfTopology, OspfRoute> { @Nonnull @VisibleForTesting RibDelta<OspfIntraAreaRoute> initializeRoutesByArea(OspfArea area) { RibDelta.Builder<OspfIntraAreaRoute> deltaBuilder = RibDelta.builder(); for (String ifaceName : area.getInterfaces()) { Interface iface = _c.getAllInterfaces().get(ifaceName); if (iface == null || !iface.getActive() || !iface.getOspfEnabled()) { continue; } Set<OspfIntraAreaRoute> allRoutes = getIfaceAddressesForIntraAreaRoutes(iface) .map( ifaceAddr -> computeIntraAreaRouteFromInterface(area.getAreaNumber(), iface, ifaceAddr)) .collect(ImmutableSet.toImmutableSet()); allRoutes.forEach(r -> deltaBuilder.from(_intraAreaRib.mergeRouteGetDelta(r))); } return deltaBuilder.build(); } }
OspfRoutingProcess implements RoutingProcess<OspfTopology, OspfRoute> { @Nonnull @VisibleForTesting RibDelta<OspfIntraAreaRoute> initializeRoutesByArea(OspfArea area) { RibDelta.Builder<OspfIntraAreaRoute> deltaBuilder = RibDelta.builder(); for (String ifaceName : area.getInterfaces()) { Interface iface = _c.getAllInterfaces().get(ifaceName); if (iface == null || !iface.getActive() || !iface.getOspfEnabled()) { continue; } Set<OspfIntraAreaRoute> allRoutes = getIfaceAddressesForIntraAreaRoutes(iface) .map( ifaceAddr -> computeIntraAreaRouteFromInterface(area.getAreaNumber(), iface, ifaceAddr)) .collect(ImmutableSet.toImmutableSet()); allRoutes.forEach(r -> deltaBuilder.from(_intraAreaRib.mergeRouteGetDelta(r))); } return deltaBuilder.build(); } OspfRoutingProcess(
      OspfProcess process, String vrfName, Configuration configuration, OspfTopology topology); }
OspfRoutingProcess implements RoutingProcess<OspfTopology, OspfRoute> { @Nonnull @VisibleForTesting RibDelta<OspfIntraAreaRoute> initializeRoutesByArea(OspfArea area) { RibDelta.Builder<OspfIntraAreaRoute> deltaBuilder = RibDelta.builder(); for (String ifaceName : area.getInterfaces()) { Interface iface = _c.getAllInterfaces().get(ifaceName); if (iface == null || !iface.getActive() || !iface.getOspfEnabled()) { continue; } Set<OspfIntraAreaRoute> allRoutes = getIfaceAddressesForIntraAreaRoutes(iface) .map( ifaceAddr -> computeIntraAreaRouteFromInterface(area.getAreaNumber(), iface, ifaceAddr)) .collect(ImmutableSet.toImmutableSet()); allRoutes.forEach(r -> deltaBuilder.from(_intraAreaRib.mergeRouteGetDelta(r))); } return deltaBuilder.build(); } OspfRoutingProcess(
      OspfProcess process, String vrfName, Configuration configuration, OspfTopology topology); @Override void initialize(Node n); @Override void executeIteration(Map<String, Node> allNodes); @Override void updateTopology(OspfTopology topology); @Nonnull @Override RibDelta<OspfRoute> getUpdatesForMainRib(); @Override void redistribute(RibDelta<? extends AnnotatedRoute<AbstractRoute>> mainRibDelta); @Override boolean isDirty(); }
OspfRoutingProcess implements RoutingProcess<OspfTopology, OspfRoute> { @Nonnull @VisibleForTesting RibDelta<OspfIntraAreaRoute> initializeRoutesByArea(OspfArea area) { RibDelta.Builder<OspfIntraAreaRoute> deltaBuilder = RibDelta.builder(); for (String ifaceName : area.getInterfaces()) { Interface iface = _c.getAllInterfaces().get(ifaceName); if (iface == null || !iface.getActive() || !iface.getOspfEnabled()) { continue; } Set<OspfIntraAreaRoute> allRoutes = getIfaceAddressesForIntraAreaRoutes(iface) .map( ifaceAddr -> computeIntraAreaRouteFromInterface(area.getAreaNumber(), iface, ifaceAddr)) .collect(ImmutableSet.toImmutableSet()); allRoutes.forEach(r -> deltaBuilder.from(_intraAreaRib.mergeRouteGetDelta(r))); } return deltaBuilder.build(); } OspfRoutingProcess(
      OspfProcess process, String vrfName, Configuration configuration, OspfTopology topology); @Override void initialize(Node n); @Override void executeIteration(Map<String, Node> allNodes); @Override void updateTopology(OspfTopology topology); @Nonnull @Override RibDelta<OspfRoute> getUpdatesForMainRib(); @Override void redistribute(RibDelta<? extends AnnotatedRoute<AbstractRoute>> mainRibDelta); @Override boolean isDirty();  }