public static boolean interfaceHasVlan(VdsNetworkInterface iface, List<VdsNetworkInterface> allIfaces) { return allIfaces.stream().anyMatch(i -> NetworkCommonUtils.isVlan(i) && interfaceBasedOn(i, iface.getName())); }
/** * Returns the underlying interface name of a given nic * * @return Base interface name if the nic is a vlan device. * Otherwise, the name of the nic */ public static String stripVlan(VdsNetworkInterface nic) { return isVlan(nic) ? nic.getBaseInterface() : nic.getName(); }
private boolean isPhysicalNic(VdsNetworkInterface nic, Set<String> bondNames, Set<String> slaveNames) { boolean isBond = bondNames.contains(nic.getName()); boolean isRemovedBond = hostSetupNetworksParametersData.getRemovedBonds().contains(nic.getId()); boolean isSlave = slaveNames.contains(nic.getName()); boolean isVlanDevice = NetworkCommonUtils.isVlan(nic); return !(isBond || isRemovedBond || isSlave || isVlanDevice); }