@Test public void testInferClusterId_eBGP() { org.batfish.datamodel.BgpProcess newProc = new org.batfish.datamodel.BgpProcess( Ip.parse("1.1.1.1"), ConfigurationFormat.CUMULUS_CONCATENATED); BgpVrf bgpVrf = new BgpVrf("bgpVrf"); bgpVrf.setClusterId(Ip.parse("2.2.2.2")); bgpVrf.setAutonomousSystem(2000L); BgpNeighbor neighbor = new BgpInterfaceNeighbor("iface"); neighbor.setRemoteAs(123L); assertThat(inferClusterId(bgpVrf, newProc.getRouterId(), neighbor), equalTo(null)); }
@VisibleForTesting @Nullable static Long inferClusterId(final BgpVrf bgpVrf, final Ip routerId, final BgpNeighbor neighbor) { if (!Objects.equals(neighbor.getRemoteAs(), bgpVrf.getAutonomousSystem())) { return null; } return bgpVrf.getClusterId() != null ? bgpVrf.getClusterId().asLong() : routerId.asLong(); }
CumulusConversions { @VisibleForTesting @Nullable static Long inferClusterId(final BgpVrf bgpVrf, final Ip routerId, final BgpNeighbor neighbor) { if (!Objects.equals(neighbor.getRemoteAs(), bgpVrf.getAutonomousSystem())) { return null; } return bgpVrf.getClusterId() != null ? bgpVrf.getClusterId().asLong() : routerId.asLong(); } }
CumulusConversions { @VisibleForTesting @Nullable static Long inferClusterId(final BgpVrf bgpVrf, final Ip routerId, final BgpNeighbor neighbor) { if (!Objects.equals(neighbor.getRemoteAs(), bgpVrf.getAutonomousSystem())) { return null; } return bgpVrf.getClusterId() != null ? bgpVrf.getClusterId().asLong() : routerId.asLong(); }  }
CumulusConversions { @VisibleForTesting @Nullable static Long inferClusterId(final BgpVrf bgpVrf, final Ip routerId, final BgpNeighbor neighbor) { if (!Objects.equals(neighbor.getRemoteAs(), bgpVrf.getAutonomousSystem())) { return null; } return bgpVrf.getClusterId() != null ? bgpVrf.getClusterId().asLong() : routerId.asLong(); }  static @Nonnull String computeBgpCommonExportPolicyName(String vrfName); @VisibleForTesting static @Nonnull String computeBgpPeerExportPolicyName(
      String vrfName, String peerInterface); static @Nonnull String computeBgpPeerImportPolicyName(String vrf, String peer); static String computeBgpGenerationPolicyName(boolean ipv4, String vrfName, String prefix); static String computeMatchSuppressedSummaryOnlyPolicyName(String vrfName); static String computeOspfExportPolicyName(String vrfName); }
CumulusConversions { @VisibleForTesting @Nullable static Long inferClusterId(final BgpVrf bgpVrf, final Ip routerId, final BgpNeighbor neighbor) { if (!Objects.equals(neighbor.getRemoteAs(), bgpVrf.getAutonomousSystem())) { return null; } return bgpVrf.getClusterId() != null ? bgpVrf.getClusterId().asLong() : routerId.asLong(); }  static @Nonnull String computeBgpCommonExportPolicyName(String vrfName); @VisibleForTesting static @Nonnull String computeBgpPeerExportPolicyName(
      String vrfName, String peerInterface); static @Nonnull String computeBgpPeerImportPolicyName(String vrf, String peer); static String computeBgpGenerationPolicyName(boolean ipv4, String vrfName, String prefix); static String computeMatchSuppressedSummaryOnlyPolicyName(String vrfName); static String computeOspfExportPolicyName(String vrfName); static final int DEFAULT_STATIC_ROUTE_ADMINISTRATIVE_DISTANCE; static final int DEFAULT_STATIC_ROUTE_METRIC; static final Ip CLAG_LINK_LOCAL_IP; static final long DEFAULT_MAX_MED; static final double SPEED_CONVERSION_FACTOR; static final double DEFAULT_LOOPBACK_BANDWIDTH; static final double DEFAULT_PORT_BANDWIDTH; }