@Override public String getIpv6Address() { return nic.getIpv6Address(); }
@Override public boolean test(VdsNetworkInterface iface) { return address != null && (ipAddressPredicate.test(iface.getIpv4Address()) || ipAddressPredicate.test(iface.getIpv6Address())); } }
@Override public String getIpv6Address() { return shouldTakeIpv6DataFromNic() ? nic.getIpv6Address() : super.getIpv6Address(); }
private HostInterfaceLineModel lineModelFromInterface(VdsNetworkInterface nic) { HostInterfaceLineModel model = new HostInterfaceLineModel(); model.setInterfaces(new ArrayList<HostInterface>()); model.setVLans(new ArrayList<HostVLan>()); model.setNetworkName(nic.getNetworkName()); model.setIsManagement(nic.getIsManagement()); model.setIpv4Address(nic.getIpv4Address()); model.setIpv6Address(nic.getIpv6Address()); return model; }
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); } }
private HostInterfaceLineModel lineModelFromBond(VdsNetworkInterface nic) { HostInterfaceLineModel model = lineModelFromInterface(nic); model.setInterface(nic); model.setIsBonded(true); model.setBondName(nic.getName()); model.setIpv4Address(nic.getIpv4Address()); model.setIpv6Address(nic.getIpv6Address()); return model; }
@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 HostVLan hostVlanFromNic(VdsNetworkInterface nic) { HostVLan hv = new HostVLan(); hv.setInterface(nic); hv.setName(nic.getName()); hv.setNetworkName(nic.getNetworkName()); hv.setIpv4Address(nic.getIpv4Address()); hv.setIpv6Address(nic.getIpv6Address()); hv.getPropertyChangedEvent().addListener(this); return hv; }
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()); } }
private HostInterface hostInterfaceFromNic(VdsNetworkInterface nic) { HostInterface hi = new HostInterface(); hi.setInterface(nic); hi.setName(nic.getName()); hi.setIpv4Address(nic.getIpv4Address()); hi.setIpv6Address(nic.getIpv6Address()); hi.setMAC(nic.getMacAddress()); hi.setSpeed(nic.getSpeed()); hi.setRxRate(nic.getStatistics().getReceiveRate()); hi.setRxTotal(nic.getStatistics().getReceivedBytes()); hi.setRxDrop(nic.getStatistics().getReceiveDropRate()); hi.setTxRate(nic.getStatistics().getTransmitRate()); hi.setTxTotal(nic.getStatistics().getTransmittedBytes()); hi.setTxDrop(nic.getStatistics().getTransmitDropRate()); hi.setStatus(nic.getStatistics().getStatus()); hi.getPropertyChangedEvent().addListener(this); return hi; }
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); }
private MapSqlParameterSource createInterfaceParametersMapper(VdsNetworkInterface nic) { return getCustomMapSqlParameterSource() .addValue("addr", nic.getIpv4Address()) .addValue("ipv6_address", nic.getIpv6Address()) .addValue("bond_name", nic.getBondName()) .addValue("bond_type", nic.getBondType())