public OspfArea.Builder ospfAreaBuilder() { return OspfArea.builder(this); }
/** @deprecated Use {@link #getAreaNumber} */ @Deprecated public long getName() { return getAreaNumber(); }
@Override protected Set<String> featureValueOf(OspfArea actual) { return actual.getInterfaces(); } }
/** * Decide whether a default inter-area OSPF route should be originated by neighbor * * @param process the receiving node's {@link OspfProcess} * @param neighborProc The adjacent {@link OspfProcess} * @param neighborArea The propagator's OSPF area configuration * @return {@code true} iff the route should be considered for installation into the OSPF RIB */ public static boolean isOspfInterAreaDefaultOriginationAllowed( OspfProcess process, OspfProcess neighborProc, OspfArea area, OspfArea neighborArea) { return neighborProc.isAreaBorderRouter() && !process.isAreaBorderRouter() && neighborArea.getInjectDefaultRoute() && (neighborArea.getStubType() == StubType.STUB || (neighborArea.getStubType() == StubType.NSSA && neighborArea.getNssa().getDefaultOriginateType() == OspfDefaultOriginateType.INTER_AREA)); }
if ((neighborArea.getStubType() == StubType.STUB && neighborArea.getStub().getSuppressType3()) || (neighborArea.getStubType() == StubType.NSSA && neighborArea.getNssa().getSuppressType3())) { return false; neighborProc.getAreas().get(neighborRouteAreaNum).getSummaryFilter(); boolean hasSummaryFilter = neighborSummaryFilterName != null; boolean allowed = !hasSummaryFilter;
areas.computeIfAbsent(areaNum, areaNumber -> OspfArea.builder().setNumber(areaNumber)); ImmutableSortedSet.Builder<String> newAreaInterfacesBuilder = areaInterfacesBuilders.computeIfAbsent(areaNum, n -> ImmutableSortedSet.naturalOrder()); c.getRouteFilterLists().put(summaryFilterName, summaryFilter); if (area == null) { area = OspfArea.builder().setNumber(areaLong); areas.put(areaLong, area); .forEach( area -> area.getInterfaces() .forEach( ifaceName ->
return false; long metric = incrementalCost + area.getMetricOfDefaultRoute(); return _ospfInterAreaStagingRib.mergeRoute( (OspfInterAreaRoute) .setAdmin(adminCost) .setMetric(metric) .setArea(area.getAreaNumber()) .build());
iface.setOspfArea(_ospfArea); if (_ospfArea != null) { _ospfArea.addInterface(name); iface.setOspfAreaName(_ospfArea.getAreaNumber());
@Override protected OspfAreaSummary featureValueOf(OspfArea actual) { return actual.getSummaries().get(_summaryPrefix); } }
@Override protected StubType featureValueOf(OspfArea actual) { return actual.getStubType(); } }
@Override protected Integer featureValueOf(OspfArea actual) { return actual.getMetricOfDefaultRoute(); } }
@Override protected Boolean featureValueOf(OspfArea actual) { return actual.getInjectDefaultRoute(); } }
@Override protected StubSettings featureValueOf(OspfArea actual) { return actual.getStub(); } }
@Override protected NssaSettings featureValueOf(OspfArea actual) { return actual.getNssa(); } }
if ((neighborArea.getStubType() == StubType.STUB && neighborArea.getStub().getSuppressType3()) || (neighborArea.getStubType() == StubType.NSSA && neighborArea.getNssa().getSuppressType3())) { return false; String neighborSummaryFilterName = neighborArea.getSummaryFilter(); boolean hasSummaryFilter = neighborSummaryFilterName != null; boolean allowed = !hasSummaryFilter;
long areaNum = e.getKey(); OspfArea area = e.getValue(); for (Entry<Prefix, OspfAreaSummary> e2 : area.getSummaries().entrySet()) { Prefix prefix = e2.getKey(); OspfAreaSummary summary = e2.getValue();
_vrf.getInterfaces().get(ospfEdge.getNode1().getInterfaceName()).getOspfArea(); assert localArea != null; // otherwise the edge would not be built. if (localArea.getStubType() == StubType.STUB) { return;
@JsonIgnore public void setOspfArea(@Nullable OspfArea ospfArea) { if (ospfArea == null) { _ospfAreaName = null; } else { _ospfAreaName = ospfArea.getAreaNumber(); } }
/** Initialize interface costs for all interfaces that belong to this process */ public void initInterfaceCosts(Configuration c) { _areas.values().stream() .flatMap(a -> a.getInterfaces().stream()) .map(interfaceName -> c.getAllInterfaces().get(interfaceName)) .filter(Interface::getActive) .forEach(i -> i.setOspfCost(computeInterfaceCost(i))); }
private org.batfish.datamodel.ospf.OspfArea.Builder toOspfAreaBuilder( OspfArea area, RouteFilterList summaryFilter) { org.batfish.datamodel.ospf.OspfArea.Builder newAreaBuilder = org.batfish.datamodel.ospf.OspfArea.builder(); newAreaBuilder.setNumber(area.getName()); newAreaBuilder.setNssaSettings(toNssaSettings(area.getNssaSettings()));