Search in sources :

Example 6 with IpV6Address

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));
    }
}
Also used : IpV6Address(org.ovirt.engine.core.common.businessentities.network.IpV6Address) IPv4Address(org.ovirt.engine.core.common.businessentities.network.IPv4Address)

Example 7 with 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);
    }
}
Also used : IpV6Address(org.ovirt.engine.core.common.businessentities.network.IpV6Address)

Example 8 with IpV6Address

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;
}
Also used : IpV6Address(org.ovirt.engine.core.common.businessentities.network.IpV6Address)

Example 9 with 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;
}
Also used : IpV6Address(org.ovirt.engine.core.common.businessentities.network.IpV6Address)

Example 10 with IpV6Address

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);
}
Also used : NetworkParameters(org.ovirt.engine.ui.uicommonweb.models.hosts.NetworkParameters) IpV6Address(org.ovirt.engine.core.common.businessentities.network.IpV6Address) IPv4Address(org.ovirt.engine.core.common.businessentities.network.IPv4Address) NetworkAttachment(org.ovirt.engine.core.common.businessentities.network.NetworkAttachment)

Aggregations

IpV6Address (org.ovirt.engine.core.common.businessentities.network.IpV6Address)19 IPv4Address (org.ovirt.engine.core.common.businessentities.network.IPv4Address)5 IpConfiguration (org.ovirt.engine.core.common.businessentities.network.IpConfiguration)4 Test (org.junit.Test)3 IpAddressAssignment (org.ovirt.engine.api.model.IpAddressAssignment)2 Ipv6BootProtocol (org.ovirt.engine.core.common.businessentities.network.Ipv6BootProtocol)2 WebApplicationException (javax.ws.rs.WebApplicationException)1 Ip (org.ovirt.engine.api.model.Ip)1 ValidationResult (org.ovirt.engine.core.bll.ValidationResult)1 NetworkAttachment (org.ovirt.engine.core.common.businessentities.network.NetworkAttachment)1 NicToIpv4AddressFunction (org.ovirt.engine.core.utils.network.function.NicToIpv4AddressFunction)1 NicToIpv6AddressFunction (org.ovirt.engine.core.utils.network.function.NicToIpv6AddressFunction)1 NetworkParameters (org.ovirt.engine.ui.uicommonweb.models.hosts.NetworkParameters)1