@Override public String getIpv4Gateway() { return nic.getIpv4Gateway(); }
private boolean isIpv4GatewayInSync() { String gatewayDesiredValue = getIpv4PrimaryAddress().getGateway(); String gatewayActualValue = iface.getIpv4Gateway(); return Objects.equals(gatewayDesiredValue, gatewayActualValue); }
@Override public String getIpv4Gateway() { return shouldTakeIpv4DataFromNic() ? nic.getIpv4Gateway() : super.getIpv4Gateway(); }
private static void mapIpv4ToModel(VdsNetworkInterface entity, HostNic model) { BootProtocol ipv4BootProtocol = Ipv4BootProtocolMapper.map(entity.getIpv4BootProtocol()); if(ipv4BootProtocol!=null){ model.setBootProtocol(ipv4BootProtocol); } if (entity.getIpv4Address() != null || entity.getIpv4Gateway() != null || entity.getIpv4Subnet() != null) { final Ip ipv4 = new Ip(); ipv4.setVersion(IpVersion.V4); if (entity.getIpv4Address() != null) { ipv4.setAddress(entity.getIpv4Address()); } if (entity.getIpv4Gateway() != null) { ipv4.setGateway(entity.getIpv4Gateway()); } if (entity.getIpv4Subnet() != null) { ipv4.setNetmask(entity.getIpv4Subnet()); } model.setIp(ipv4); } }
@Override public IPv4Address apply(VdsNetworkInterface nic) { IPv4Address ipv4Address = new IPv4Address(); if (nic.getIpv4BootProtocol() == Ipv4BootProtocol.STATIC_IP) { ipv4Address.setAddress(nic.getIpv4Address()); ipv4Address.setNetmask(nic.getIpv4Subnet()); ipv4Address.setGateway(nic.getIpv4Gateway()); } ipv4Address.setBootProtocol(nic.getIpv4BootProtocol()); return ipv4Address; } }
private void addReportedIpv4Configuration(ReportedConfigurations result) { if (!isIpv4PrimaryAddressExist()) { return; } Ipv4BootProtocol definedIpv4BootProtocol = getIpv4PrimaryAddress().getBootProtocol(); result.add(ReportedConfigurationType.IPV4_BOOT_PROTOCOL, iface.getIpv4BootProtocol(), definedIpv4BootProtocol); if (definedIpv4BootProtocol == Ipv4BootProtocol.STATIC_IP && iface.getIpv4BootProtocol() == definedIpv4BootProtocol) { result.add(ReportedConfigurationType.IPV4_NETMASK, iface.getIpv4Subnet(), getIpv4PrimaryAddress().getNetmask(), isIpv4NetworkSubnetInSync()); result.add(ReportedConfigurationType.IPV4_ADDRESS, iface.getIpv4Address(), getIpv4PrimaryAddress().getAddress()); result.add(ReportedConfigurationType.IPV4_GATEWAY, iface.getIpv4Gateway(), getIpv4PrimaryAddress().getGateway(), isIpv4GatewayInSync()); } }
syncAddress), new ReportedConfiguration(ReportedConfigurationType.IPV4_GATEWAY, iface.getIpv4Gateway(), primaryAddress.getGateway(), syncGateway)
protected ToStringBuilder appendAttributes(ToStringBuilder tsb) { return tsb.append("id", getId()) .append("name", getName()) .append("vdsId", getVdsId()) .append("networkName", getNetworkName()) .append("ipv4BootProtocol", getIpv4BootProtocol()) .append("ipv4Address", getIpv4Address()) .append("ipv4Subnet", getIpv4Subnet()) .append("ipv4Gateway", getIpv4Gateway()) .append("ipv6BootProtocol", getIpv6BootProtocol()) .append("ipv6Address", getIpv6Address()) .append("ipv6Prefix", getIpv6Prefix()) .append("ipv6Gateway", getIpv6Gateway()) .append("mtu", getMtu()) .append("bridged", isBridged()) .append("reportedSwitchType", getReportedSwitchType()) .append("type", getType()) .append("networkImplementationDetails", getNetworkImplementationDetails()) .append("qos", getQos()) .append("adPartnerMac", getAdPartnerMac()) .append("adAggregatorId", adAggregatorId); }
.addValue("bond_name", nic.getBondName()) .addValue("bond_type", nic.getBondType()) .addValue("gateway", nic.getIpv4Gateway()) .addValue("ipv4_default_route", nic.isIpv4DefaultRoute()) .addValue("ipv6_gateway", nic.getIpv6Gateway())