@Test public void testConvertVxlan() { Vxlan vxlan = convertVxlan(VXLAN_IFACE); assertThat(vxlan.getName(), equalTo(VXLAN_IFACE.getName())); assertThat(vxlan.getId(), equalTo(VXLAN_IFACE.getVxlanId())); assertThat(vxlan.getBridgeAccessVlan(), equalTo(VXLAN_IFACE.getBridgeSettings().getAccess())); assertThat(vxlan.getLocalTunnelip(), equalTo(VXLAN_IFACE.getVxlanLocalTunnelIp())); }
@VisibleForTesting static Vxlan convertVxlan(InterfacesInterface iface) { checkArgument(isVxlan(iface), "not a vxlan"); Vxlan vxlan = new Vxlan(iface.getName()); vxlan.setId(iface.getVxlanId()); vxlan.setLocalTunnelip(iface.getVxlanLocalTunnelIp()); InterfaceBridgeSettings bridgeSettings = iface.getBridgeSettings(); if (bridgeSettings != null) { vxlan.setBridgeAccessVlan(bridgeSettings.getAccess()); } return vxlan; }
InterfaceConverter { @VisibleForTesting static Vxlan convertVxlan(InterfacesInterface iface) { checkArgument(isVxlan(iface), "not a vxlan"); Vxlan vxlan = new Vxlan(iface.getName()); vxlan.setId(iface.getVxlanId()); vxlan.setLocalTunnelip(iface.getVxlanLocalTunnelIp()); InterfaceBridgeSettings bridgeSettings = iface.getBridgeSettings(); if (bridgeSettings != null) { vxlan.setBridgeAccessVlan(bridgeSettings.getAccess()); } return vxlan; } }
InterfaceConverter { @VisibleForTesting static Vxlan convertVxlan(InterfacesInterface iface) { checkArgument(isVxlan(iface), "not a vxlan"); Vxlan vxlan = new Vxlan(iface.getName()); vxlan.setId(iface.getVxlanId()); vxlan.setLocalTunnelip(iface.getVxlanLocalTunnelIp()); InterfaceBridgeSettings bridgeSettings = iface.getBridgeSettings(); if (bridgeSettings != null) { vxlan.setBridgeAccessVlan(bridgeSettings.getAccess()); } return vxlan; } InterfaceConverter(CumulusInterfacesConfiguration interfaces, Warnings w); }
InterfaceConverter { @VisibleForTesting static Vxlan convertVxlan(InterfacesInterface iface) { checkArgument(isVxlan(iface), "not a vxlan"); Vxlan vxlan = new Vxlan(iface.getName()); vxlan.setId(iface.getVxlanId()); vxlan.setLocalTunnelip(iface.getVxlanLocalTunnelIp()); InterfaceBridgeSettings bridgeSettings = iface.getBridgeSettings(); if (bridgeSettings != null) { vxlan.setBridgeAccessVlan(bridgeSettings.getAccess()); } return vxlan; } InterfaceConverter(CumulusInterfacesConfiguration interfaces, Warnings w); Map<String, Bond> convertBonds(); @Nullable Bridge convertBridge(); Map<String, org.batfish.representation.cumulus.Interface> convertInterfaces(); Map<String, Vlan> convertVlans(); Map<String, Vrf> convertVrfs(); Map<String, Vxlan> convertVxlans(); @VisibleForTesting @Nullable static String getSuperInterfaceName(String ifaceName); @VisibleForTesting @Nullable static Integer getEncapsulationVlan(InterfacesInterface iface); static boolean isBond(InterfacesInterface iface); static boolean isVlan(InterfacesInterface iface); static boolean isVxlan(InterfacesInterface iface); static boolean isVrf(InterfacesInterface iface); static boolean isInterface(InterfacesInterface iface); }
InterfaceConverter { @VisibleForTesting static Vxlan convertVxlan(InterfacesInterface iface) { checkArgument(isVxlan(iface), "not a vxlan"); Vxlan vxlan = new Vxlan(iface.getName()); vxlan.setId(iface.getVxlanId()); vxlan.setLocalTunnelip(iface.getVxlanLocalTunnelIp()); InterfaceBridgeSettings bridgeSettings = iface.getBridgeSettings(); if (bridgeSettings != null) { vxlan.setBridgeAccessVlan(bridgeSettings.getAccess()); } return vxlan; } InterfaceConverter(CumulusInterfacesConfiguration interfaces, Warnings w); Map<String, Bond> convertBonds(); @Nullable Bridge convertBridge(); Map<String, org.batfish.representation.cumulus.Interface> convertInterfaces(); Map<String, Vlan> convertVlans(); Map<String, Vrf> convertVrfs(); Map<String, Vxlan> convertVxlans(); @VisibleForTesting @Nullable static String getSuperInterfaceName(String ifaceName); @VisibleForTesting @Nullable static Integer getEncapsulationVlan(InterfacesInterface iface); static boolean isBond(InterfacesInterface iface); static boolean isVlan(InterfacesInterface iface); static boolean isVxlan(InterfacesInterface iface); static boolean isVrf(InterfacesInterface iface); static boolean isInterface(InterfacesInterface iface); @VisibleForTesting static final String BRIDGE_NAME; static final Set<String> DEFAULT_BRIDGE_PORTS; static final int DEFAULT_BRIDGE_PVID; }