use of org.ovirt.engine.core.common.businessentities.network.IpV6Address in project ovirt-engine by oVirt.
the class IpConfigurationCompleter method completeDefaultIpConfiguration.
private void completeDefaultIpConfiguration(IpConfiguration ipConfiguration) {
if (ipConfiguration.getIPv4Addresses().isEmpty()) {
final IPv4Address ipv4Address = NetworkCommonUtils.createDefaultIpv4Address();
ipConfiguration.setIPv4Addresses(Collections.singletonList(ipv4Address));
}
if (ipConfiguration.getIpV6Addresses().isEmpty()) {
final IpV6Address ipv6Address = NetworkCommonUtils.createDefaultIpv6Address();
ipConfiguration.setIpV6Addresses(Collections.singletonList(ipv6Address));
}
}
use of org.ovirt.engine.core.common.businessentities.network.IpV6Address in project ovirt-engine by oVirt.
the class NetworkAttachmentDaoImpl method mapIpv6Configuration.
private void mapIpv6Configuration(MapSqlParameterSource mapper, IpConfiguration ipConfiguration) {
if (ipConfiguration.hasIpv6PrimaryAddressSet()) {
final IpV6Address primaryIpv6Address = ipConfiguration.getIpv6PrimaryAddress();
mapper.addValue("ipv6_boot_protocol", EnumUtils.nameOrNull(primaryIpv6Address.getBootProtocol())).addValue("ipv6_address", primaryIpv6Address.getAddress()).addValue("ipv6_prefix", primaryIpv6Address.getPrefix()).addValue("ipv6_gateway", primaryIpv6Address.getGateway());
} else {
mapper.addValue("ipv6_boot_protocol", null).addValue("ipv6_address", null).addValue("ipv6_prefix", null).addValue("ipv6_gateway", null);
}
}
use of org.ovirt.engine.core.common.businessentities.network.IpV6Address in project ovirt-engine by oVirt.
the class NetworkAttachmentDaoImplTest method createPrimaryIpv6Address.
public IpV6Address createPrimaryIpv6Address() {
IpV6Address ipv6Address = new IpV6Address();
ipv6Address.setBootProtocol(Ipv6BootProtocol.DHCP);
return ipv6Address;
}
use of org.ovirt.engine.core.common.businessentities.network.IpV6Address in project ovirt-engine by oVirt.
the class NetworkAttachmentDaoImplTest method createIpv6Address.
private IpV6Address createIpv6Address(Ipv6BootProtocol ipv6BootProtocol) {
IpV6Address primaryIpv6Address = new IpV6Address();
primaryIpv6Address.setBootProtocol(ipv6BootProtocol);
primaryIpv6Address.setAddress(randomIpv6Address());
primaryIpv6Address.setGateway(randomIpv6Address());
primaryIpv6Address.setPrefix(64);
return primaryIpv6Address;
}
use of org.ovirt.engine.core.common.businessentities.network.IpV6Address in project ovirt-engine by oVirt.
the class LogicalNetworkModelParametersHelper method storeAttachmentParamsBeforeDetach.
private void storeAttachmentParamsBeforeDetach() {
NetworkAttachment networkAttachment = networkModel.getNetworkAttachment();
if (networkAttachment == null) {
return;
}
NetworkParameters netParams = new NetworkParameters();
IPv4Address ipv4Address = networkAttachment.getIpConfiguration().getIpv4PrimaryAddress();
if (ipv4Address != null) {
netParams.setIpv4BootProtocol(ipv4Address.getBootProtocol());
netParams.setIpv4Address(ipv4Address.getAddress());
netParams.setIpv4Netmask(ipv4Address.getNetmask());
netParams.setIpv4Gateway(ipv4Address.getGateway());
}
IpV6Address ipv6Address = networkAttachment.getIpConfiguration().getIpv6PrimaryAddress();
if (ipv6Address != null) {
netParams.setIpv6BootProtocol(ipv6Address.getBootProtocol());
netParams.setIpv6Address(ipv6Address.getAddress());
netParams.setIpv6Prefix(ipv6Address.getPrefix());
netParams.setIpv6Gateway(ipv6Address.getGateway());
}
netParams.setHostNetworkQos(HostNetworkQos.fromAnonymousHostNetworkQos(networkAttachment.getHostNetworkQos()));
netParams.setQosOverridden(networkAttachment.isQosOverridden());
netParams.setCustomProperties(networkAttachment.getProperties());
netParams.setDnsResolverConfiguration(networkAttachment.getDnsResolverConfiguration());
networkModel.getSetupModel().getNetworkToLastDetachParams().put(networkModel.getName(), netParams);
}
Aggregations