@Override public Integer getIpv6Prefix() { return nic.getIpv6Prefix(); }
private boolean isIpv6PrefixInSync() { return Objects.equals(iface.getIpv6Prefix(), getIpv6PrimaryAddress().getPrefix()); }
@Override public Integer getIpv6Prefix() { return shouldTakeIpv6DataFromNic() ? nic.getIpv6Prefix() : super.getIpv6Prefix(); }
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("speed", nic.getSpeed()) .addValue("subnet", nic.getIpv4Subnet()) .addValue("ipv6_prefix", nic.getIpv6Prefix()) .addValue("boot_protocol", nic.getIpv4BootProtocol()) .addValue("ipv6_boot_protocol", nic.getIpv6BootProtocol())