public SubnetsBuilder(Subnets base) { if (base.getKey() == null) { this._key = new SubnetsKey( base.getPrefix() ); this._prefix = base.getPrefix(); } else { this._key = base.getKey(); this._prefix = _key.getPrefix(); } this._deviceVteps = base.getDeviceVteps(); this._gatewayIp = base.getGatewayIp(); this._vlanId = base.getVlanId(); this._vteps = base.getVteps(); if (base instanceof SubnetsImpl) { SubnetsImpl impl = (SubnetsImpl) base; if (!impl.augmentation.isEmpty()) { this.augmentation = new HashMap<>(impl.augmentation); } } else if (base instanceof AugmentationHolder) { @SuppressWarnings("unchecked") AugmentationHolder<org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.rev160406.transport.zones.transport.zone.Subnets> casted =(AugmentationHolder<org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.rev160406.transport.zones.transport.zone.Subnets>) base; if (!casted.augmentations().isEmpty()) { this.augmentation = new HashMap<>(casted.augmentations()); } } }
if (sub.getDeviceVteps() != null && !sub.getDeviceVteps().isEmpty()) { for (DeviceVteps hwVtepDS : sub.getDeviceVteps()) { String cssID = dpn.getDPNID().toString(); if (sub.getDeviceVteps() != null && !sub.getDeviceVteps().isEmpty()) { for (DeviceVteps hwVtepDS : sub.getDeviceVteps()) { logger.trace("hwtepDS exists {}", hwVtepDS); if (sub.getVteps() != null && !sub.getVteps().isEmpty()) { for (Vteps vtep : sub.getVteps()) { String parentIf = ItmUtils.getInterfaceName(vtep.getDpnId(), vtep.getPortname(), sub.getVlanId()); deleteTrunksCSSTOR(dataBroker, idManagerService, vtep.getDpnId(), parentIf, vtep.getIpAddress(), hwTep.getTopo_id(), hwTep.getNode_id(), hwTep.getHwIp(),
.builder(TransportZones.class) .child(TransportZone.class, tZ.getKey()) .child(Subnets.class, sub.getKey()) .child(Vteps.class, vtep.getKey()).build(); if (sub.getVteps().remove(vtep)) { vtepPaths.add(vpath); if (sub.getVteps().size() == 0 || sub.getVteps() == null) { subDelList.add(sub); .builder(TransportZones.class) .child(TransportZone.class, tZ.getKey()) .child(Subnets.class, sub.getKey()).build(); subnetPaths.add(spath); if (tZ.getSubnets() == null || tZ.getSubnets().size() == 0) {
if (subOptional.isPresent()) { subCli = subOptional.get(); if(subCli.getGatewayIp().equals(gatewayIpObj) && subCli.getVlanId().equals(vlanId)){ vtepDelCommitList.add(vtepCli);
private Subnets findSubnets(List<Subnets> subnets, String subnetIp) { for (Subnets subnet : subnets) { IpPrefix subnetPrefix = new IpPrefix(subnetIp.toCharArray()); if (subnet.getPrefix().equals(subnetPrefix)) { return subnet; } } Subnets retSubnet = newSubnets(subnetIp); subnets.add(retSubnet); return retSubnet; }
return result; SubnetsKey subnetsKey = tZones.getTransportZone().get(0).getSubnets().get(0).getKey(); DeviceVtepsKey deviceVtepKey = new DeviceVtepsKey(hwIp, node_id.get(0)); InstanceIdentifier<DeviceVteps> path =
if (tZoneOptional.get().getSubnets() != null && !tZoneOptional.get().getSubnets().isEmpty()) { for (Subnets sub : tZoneOptional.get().getSubnets()) { if (sub.getVteps() != null && !sub.getVteps().isEmpty()) { for (Vteps vtepLocal : sub.getVteps()) { for (Vteps vtepRemote : sub.getVteps()) { if (!vtepLocal.equals(vtepRemote)) { InternalTunnelKey key = new InternalTunnelKey(vtepRemote.getDpnId(), vtepLocal.getDpnId(), tZoneOptional.get().getTunnelType());
return result; SubnetsKey subnetsKey = tZones.getTransportZone().get(0).getSubnets().get(0).getKey(); DeviceVtepsKey deviceVtepKey = new DeviceVtepsKey(hwIp, node_id.get(0)); InstanceIdentifier<DeviceVteps> path =
if (!Objects.equals(_deviceVteps, other.getDeviceVteps())) { return false; if (!Objects.equals(_gatewayIp, other.getGatewayIp())) { return false; if (!Objects.equals(_key, other.getKey())) { return false; if (!Objects.equals(_prefix, other.getPrefix())) { return false; if (!Objects.equals(_vlanId, other.getVlanId())) { return false; if (!Objects.equals(_vteps, other.getVteps())) { return false; if (!e.getValue().equals(other.getAugmentation(e.getKey()))) { return false;
private int addVtep(TransportZone zone, String subnetIp, BigInteger dpnId) throws Exception { Subnets subnets = findSubnets(zone.getSubnets(), subnetIp); for(Vteps existingVtep : subnets.getVteps()){ if (existingVtep.getDpnId().equals(dpnId)) { return 0; } } IpAddress nodeIp = getNodeIP(dpnId); VtepsBuilder vtepsBuilder = new VtepsBuilder(); vtepsBuilder.setDpnId(dpnId); vtepsBuilder.setIpAddress(nodeIp); vtepsBuilder.setPortname(TUNNEL_PORT); subnets.getVteps().add(vtepsBuilder.build()); return 1; }
return result; SubnetsKey subnetsKey = tzone.getSubnets().get(0).getKey(); DeviceVtepsKey deviceVtepKey = new DeviceVtepsKey(hwIp, node_id); InstanceIdentifier<DeviceVteps> path = InstanceIdentifier.builder(TransportZones.class)
if (subnetsList != null) { for (Subnets subnet : subnetsList) { IpPrefix ipPrefix = subnet.getPrefix(); IpAddress gatewayIP = subnet.getGatewayIp(); int vlanID = subnet.getVlanId(); LOG.trace("IpPrefix: {}, gatewayIP: {}, vlanID: {} ", ipPrefix, gatewayIP, vlanID); List<DeviceVteps> deviceVtepsList = subnet.getDeviceVteps(); if (deviceVtepsList != null) { for (DeviceVteps vteps : deviceVtepsList) {
List<Vteps> vtepList = sub.getVteps(); validateForDuplicateAndSingleGreTep(inputVtep, isConfiguredTepGreType, isGreType, vtepList);
return result; SubnetsKey subnetsKey = tzone.getSubnets().get(0).getKey(); DeviceVtepsKey deviceVtepKey = new DeviceVtepsKey(hwIp, node_id); InstanceIdentifier<DeviceVteps> path = InstanceIdentifier.builder(TransportZones.class)
if(subnetsList!=null){ for (Subnets subnet : subnetsList) { IpPrefix ipPrefix = subnet.getPrefix(); IpAddress gatewayIP = subnet.getGatewayIp(); int vlanID = subnet.getVlanId(); LOG.trace("IpPrefix: {}, gatewayIP: {}, vlanID: {} ", ipPrefix, gatewayIP, vlanID); List<Vteps> vtepsList = subnet.getVteps(); if(vtepsList!=null && !vtepsList.isEmpty()) { for (Vteps vteps : vtepsList) {
if (tZoneOptional.get().getSubnets() != null && !tZoneOptional.get().getSubnets().isEmpty()) { for (Subnets sub : tZoneOptional.get().getSubnets()) { if (sub.getVteps() != null && !sub.getVteps().isEmpty()) { for (Vteps vtepLocal : sub.getVteps()) { for (Vteps vtepRemote : sub.getVteps()) { if (!vtepLocal.equals(vtepRemote)) { InternalTunnelKey key = new InternalTunnelKey(vtepRemote.getDpnId(), vtepLocal.getDpnId(), tunType);
if (sub.getVteps() == null || sub.getVteps().isEmpty()) { LOG.error("Transport Zone " + tZ.getZoneName() + "subnet " + sub.getPrefix() + "has no vteps"); continue; for (Vteps vtep : sub.getVteps()) { flag = true; String strTunnelType ; strTunnelType = ITMConstants.TUNNEL_TYPE_VXLAN ; result.add(String.format("%-16s %-16s %-16s %-12s %-12s %-12s %-16s %-12s", tZ.getZoneName(), strTunnelType, sub .getPrefix().getIpv4Prefix().getValue(), sub.getGatewayIp().getIpv4Address() .getValue(), sub.getVlanId().toString(), vtep.getDpnId().toString(), vtep .getIpAddress().getIpv4Address().getValue(), vtep.getPortname().toString()));
if (tzone.getSubnets() != null && !tzone.getSubnets().isEmpty()) { for (Subnets sub : tzone.getSubnets()) { if (sub.getDeviceVteps() != null && !sub.getDeviceVteps().isEmpty()) { hwVtepsExist = true; for (DeviceVteps deviceVtep : sub.getDeviceVteps()) { HwVtep hwVtep = ItmUtils.createHwVtepObject(deviceVtep.getTopologyId(), deviceVtep.getNodeId(), deviceVtep.getIpAddress(), sub.getPrefix(), sub.getGatewayIp(), sub.getVlanId(), tzone.getTunnelType(), tzone); hwVteps.add(hwVtep);
if (tzone.getSubnets() != null && !tzone.getSubnets().isEmpty()) { for (Subnets sub : tzone.getSubnets()) { if (sub.getDeviceVteps() != null && !sub.getDeviceVteps().isEmpty()) { hwVtepsExist = true; for (DeviceVteps deviceVtep : sub.getDeviceVteps()) { HwVtep hwVtep = ItmUtils.createHwVtepObject(deviceVtep.getTopologyId(), deviceVtep.getNodeId(), deviceVtep.getIpAddress(), sub.getPrefix(), sub.getGatewayIp(), sub.getVlanId(), tzone.getTunnelType(), tzone); hwVteps.add(hwVtep);