@Override public String getIpv6Gateway() { return nic.getIpv6Gateway(); }
private boolean isIpv6GatewayInSync() { String gatewayDesiredValue = getIpv6PrimaryAddress().getGateway(); String gatewayActualValue = iface.getIpv6Gateway(); return Objects.equals(gatewayDesiredValue, gatewayActualValue); }
@Override public String getIpv6Gateway() { return shouldTakeIpv6DataFromNic() ? nic.getIpv6Gateway() : super.getIpv6Gateway(); }
private static void mapIpv6ToModel(VdsNetworkInterface entity, HostNic model) { BootProtocol ipv6BootProtocol = Ipv6BootProtocolMapper.map(entity.getIpv6BootProtocol()); if(ipv6BootProtocol!=null){ model.setIpv6BootProtocol(ipv6BootProtocol); } if (entity.getIpv6Address() != null || entity.getIpv6Gateway() != null || entity.getIpv6Prefix() != null) { final Ip ipv6 = new Ip(); ipv6.setVersion(IpVersion.V6); if (entity.getIpv6Address() != null) { ipv6.setAddress(entity.getIpv6Address()); } if (entity.getIpv6Gateway() != null) { ipv6.setGateway(entity.getIpv6Gateway()); } if (entity.getIpv6Prefix() != null) { ipv6.setNetmask(entity.getIpv6Prefix().toString()); } model.setIpv6(ipv6); } }
@Override public IpV6Address apply(VdsNetworkInterface nic) { IpV6Address ipv6Address = new IpV6Address(); if (nic.getIpv6BootProtocol() == Ipv6BootProtocol.STATIC_IP) { ipv6Address.setAddress(nic.getIpv6Address()); ipv6Address.setPrefix(nic.getIpv6Prefix()); ipv6Address.setGateway(nic.getIpv6Gateway()); } ipv6Address.setBootProtocol(nic.getIpv6BootProtocol()); return ipv6Address; } }
private void verifyIpv6Properties(VdsNetworkInterface nicA, VdsNetworkInterface nicB) { assertEquals(nicA.getIpv6BootProtocol(), nicB.getIpv6BootProtocol()); assertEquals(nicA.getIpv6Address(), nicB.getIpv6Address()); assertEquals(nicA.getIpv6Prefix(), nicB.getIpv6Prefix()); assertEquals(nicA.getIpv6Gateway(), nicB.getIpv6Gateway()); }
private void addReportedIpv6Configuration(ReportedConfigurations result) { if (!isIpv6PrimaryAddressExist()) { return; } Ipv6BootProtocol definedIpv6BootProtocol = getIpv6PrimaryAddress().getBootProtocol(); result.add(ReportedConfigurationType.IPV6_BOOT_PROTOCOL, iface.getIpv6BootProtocol(), definedIpv6BootProtocol); if (definedIpv6BootProtocol == Ipv6BootProtocol.STATIC_IP && iface.getIpv6BootProtocol() == definedIpv6BootProtocol) { result.add(ReportedConfigurationType.IPV6_PREFIX, iface.getIpv6Prefix(), getIpv6PrimaryAddress().getPrefix(), isIpv6PrefixInSync()); result.add(ReportedConfigurationType.IPV6_ADDRESS, iface.getIpv6Address(), getIpv6PrimaryAddress().getAddress()); result.add(ReportedConfigurationType.IPV6_GATEWAY, iface.getIpv6Gateway(), getIpv6PrimaryAddress().getGateway(), isIpv6GatewayInSync()); } }
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("gateway", nic.getIpv4Gateway()) .addValue("ipv4_default_route", nic.isIpv4DefaultRoute()) .addValue("ipv6_gateway", nic.getIpv6Gateway()) .addValue("id", nic.getId()) .addValue("is_bond", nic.getBonded())