@Test public void testCompatibleVniSettingsMismatchBumTransportTailFloodGroup() { Layer2Vni vniSettingsTail = testBuilder() .setBumTransportIps(ImmutableSortedSet.of(SRC_IP1)) .setBumTransportMethod(BumTransportMethod.UNICAST_FLOOD_GROUP) .setSourceAddress(SRC_IP1) .setUdpPort(UDP_PORT) .setVlan(VLAN1) .setVni(VNI) .build(); Layer2Vni vniSettingsHead = testBuilder() .setBumTransportIps(ImmutableSortedSet.of(SRC_IP1)) .setBumTransportMethod(BumTransportMethod.UNICAST_FLOOD_GROUP) .setSourceAddress(SRC_IP2) .setUdpPort(UDP_PORT) .setVlan(VLAN2) .setVni(VNI) .build(); assertThat(compatibleVniSettings(vniSettingsTail, vniSettingsHead), equalTo(false)); }
@VisibleForTesting static boolean compatibleVniSettings(Layer2Vni vniSettingsTail, Layer2Vni vniSettingsHead) { return vniSettingsTail.getBumTransportMethod() == vniSettingsHead.getBumTransportMethod() && vniSettingsTail.getUdpPort().equals(vniSettingsHead.getUdpPort()) && vniSettingsTail.getSourceAddress() != null && vniSettingsHead.getSourceAddress() != null && !vniSettingsTail.getSourceAddress().equals(vniSettingsHead.getSourceAddress()) && ((vniSettingsTail.getBumTransportMethod() == BumTransportMethod.MULTICAST_GROUP && vniSettingsTail .getBumTransportIps() .equals(vniSettingsHead.getBumTransportIps())) || (vniSettingsTail.getBumTransportMethod() == BumTransportMethod.UNICAST_FLOOD_GROUP && vniSettingsTail.getBumTransportIps().contains(vniSettingsHead.getSourceAddress()) && vniSettingsHead .getBumTransportIps() .contains(vniSettingsTail.getSourceAddress()))); }
VxlanTopologyUtils { @VisibleForTesting static boolean compatibleVniSettings(Layer2Vni vniSettingsTail, Layer2Vni vniSettingsHead) { return vniSettingsTail.getBumTransportMethod() == vniSettingsHead.getBumTransportMethod() && vniSettingsTail.getUdpPort().equals(vniSettingsHead.getUdpPort()) && vniSettingsTail.getSourceAddress() != null && vniSettingsHead.getSourceAddress() != null && !vniSettingsTail.getSourceAddress().equals(vniSettingsHead.getSourceAddress()) && ((vniSettingsTail.getBumTransportMethod() == BumTransportMethod.MULTICAST_GROUP && vniSettingsTail .getBumTransportIps() .equals(vniSettingsHead.getBumTransportIps())) || (vniSettingsTail.getBumTransportMethod() == BumTransportMethod.UNICAST_FLOOD_GROUP && vniSettingsTail.getBumTransportIps().contains(vniSettingsHead.getSourceAddress()) && vniSettingsHead .getBumTransportIps() .contains(vniSettingsTail.getSourceAddress()))); } }
VxlanTopologyUtils { @VisibleForTesting static boolean compatibleVniSettings(Layer2Vni vniSettingsTail, Layer2Vni vniSettingsHead) { return vniSettingsTail.getBumTransportMethod() == vniSettingsHead.getBumTransportMethod() && vniSettingsTail.getUdpPort().equals(vniSettingsHead.getUdpPort()) && vniSettingsTail.getSourceAddress() != null && vniSettingsHead.getSourceAddress() != null && !vniSettingsTail.getSourceAddress().equals(vniSettingsHead.getSourceAddress()) && ((vniSettingsTail.getBumTransportMethod() == BumTransportMethod.MULTICAST_GROUP && vniSettingsTail .getBumTransportIps() .equals(vniSettingsHead.getBumTransportIps())) || (vniSettingsTail.getBumTransportMethod() == BumTransportMethod.UNICAST_FLOOD_GROUP && vniSettingsTail.getBumTransportIps().contains(vniSettingsHead.getSourceAddress()) && vniSettingsHead .getBumTransportIps() .contains(vniSettingsTail.getSourceAddress()))); } private  VxlanTopologyUtils(); }
VxlanTopologyUtils { @VisibleForTesting static boolean compatibleVniSettings(Layer2Vni vniSettingsTail, Layer2Vni vniSettingsHead) { return vniSettingsTail.getBumTransportMethod() == vniSettingsHead.getBumTransportMethod() && vniSettingsTail.getUdpPort().equals(vniSettingsHead.getUdpPort()) && vniSettingsTail.getSourceAddress() != null && vniSettingsHead.getSourceAddress() != null && !vniSettingsTail.getSourceAddress().equals(vniSettingsHead.getSourceAddress()) && ((vniSettingsTail.getBumTransportMethod() == BumTransportMethod.MULTICAST_GROUP && vniSettingsTail .getBumTransportIps() .equals(vniSettingsHead.getBumTransportIps())) || (vniSettingsTail.getBumTransportMethod() == BumTransportMethod.UNICAST_FLOOD_GROUP && vniSettingsTail.getBumTransportIps().contains(vniSettingsHead.getSourceAddress()) && vniSettingsHead .getBumTransportIps() .contains(vniSettingsTail.getSourceAddress()))); } private  VxlanTopologyUtils(); static @Nonnull VxlanTopology computeVxlanTopology(
      Map<String, Configuration> configurations); static @Nonnull VxlanTopology computeVxlanTopology(
      Table<String, String, ? extends Collection<Layer2Vni>> allVniSettings); static @Nonnull VxlanTopology prunedVxlanTopology(
      VxlanTopology initialVxlanTopology,
      Map<String, Configuration> configurations,
      TracerouteEngine tracerouteEngine); }
VxlanTopologyUtils { @VisibleForTesting static boolean compatibleVniSettings(Layer2Vni vniSettingsTail, Layer2Vni vniSettingsHead) { return vniSettingsTail.getBumTransportMethod() == vniSettingsHead.getBumTransportMethod() && vniSettingsTail.getUdpPort().equals(vniSettingsHead.getUdpPort()) && vniSettingsTail.getSourceAddress() != null && vniSettingsHead.getSourceAddress() != null && !vniSettingsTail.getSourceAddress().equals(vniSettingsHead.getSourceAddress()) && ((vniSettingsTail.getBumTransportMethod() == BumTransportMethod.MULTICAST_GROUP && vniSettingsTail .getBumTransportIps() .equals(vniSettingsHead.getBumTransportIps())) || (vniSettingsTail.getBumTransportMethod() == BumTransportMethod.UNICAST_FLOOD_GROUP && vniSettingsTail.getBumTransportIps().contains(vniSettingsHead.getSourceAddress()) && vniSettingsHead .getBumTransportIps() .contains(vniSettingsTail.getSourceAddress()))); } private  VxlanTopologyUtils(); static @Nonnull VxlanTopology computeVxlanTopology(
      Map<String, Configuration> configurations); static @Nonnull VxlanTopology computeVxlanTopology(
      Table<String, String, ? extends Collection<Layer2Vni>> allVniSettings); static @Nonnull VxlanTopology prunedVxlanTopology(
      VxlanTopology initialVxlanTopology,
      Map<String, Configuration> configurations,
      TracerouteEngine tracerouteEngine);  }