@Override protected Integer featureValueOf(Interface actual) { return actual.getOspfCost(); } }
private Integer addedCost(Protocol proto, GraphEdge ge) { if (proto.isOspf()) { return ge.getStart().getOspfCost(); } return 1; }
@VisibleForTesting static int computeInterfaceCost(Double referenceBandwidth, Interface i) { Integer ospfCost = i.getOspfCost(); if (ospfCost != null) { return ospfCost; } String interfaceName = i.getName(); if (interfaceName.startsWith("Vlan")) { // Special handling for VLAN interfaces // TODO: fix for non-cisco return DEFAULT_CISCO_VLAN_OSPF_COST; } else { // Regular physical interface cost computation checkState( i.getBandwidth() != null, "Interface %s on %s is missing bandwidth, cannot compute OSPF cost", interfaceName, i.getOwner().getHostname()); return Math.max((int) (referenceBandwidth / i.getBandwidth()), 1); } }
BDDAcl aclIn = _inAcls.get(ge); BDDAcl aclOut = _outAcls.get(ge); Integer ospfCost = ge.getStart().getOspfCost(); SortedSet<Pair<Prefix, Integer>> staticPrefixes = new TreeSet<>(); SortedSet<StaticRoute> staticRoutes = conf.getDefaultVrf().getStaticRoutes();
int linkCost = ospfNeighbor.getIface().getOspfCost(); int remoteLinkCost = remoteOspfNeighbor.getIface().getOspfCost(); if (linkCost != remoteLinkCost) { answerElement.add(
.map(InterfaceAddress::getPrefix) .collect(Collectors.toSet()); int interfaceOspfCost = iface.getOspfCost(); for (Prefix prefix : allNetworkPrefixes) { long cost = interfaceOspfCost;
assertThat(i0.getOspfCost(), equalTo(100000)); assertThat(i1.getOspfCost(), equalTo(10000)); assertThat(i2.getOspfCost(), nullValue()); assertThat(i3.getOspfCost(), equalTo(100));
int connectingInterfaceCost = connectingInterface.getOspfCost(); long incrementalCost = proc.getMaxMetricTransitLinks() != null
proc.getMaxMetricTransitLinks() != null ? proc.getMaxMetricTransitLinks() : localInterface.getOspfCost().longValue();