private NeutronSubnet getExternalNetworkSubnet(NeutronPort gatewayPort){ if (gatewayPort.getFixedIPs() == null) { return null; } for (Neutron_IPs neutronIPs : gatewayPort.getFixedIPs()) { String subnetUUID = neutronIPs.getSubnetUUID(); NeutronSubnet extSubnet = neutronSubnetCache.getSubnet(subnetUUID); if (extSubnet != null && extSubnet.getGatewayIP() != null) { return extSubnet; } if (extSubnet == null) { // TODO: when subnet is created, try again. LOG.debug("subnet {} in not found", subnetUUID); } } return null; }
if (port.getFixedIPs() == null) { continue; for (Neutron_IPs vmIp : port.getFixedIPs()) { securityServicesManager.syncSecurityRule(cachedport, securityRule, vmIp, true);
if (securityGroup.getSecurityGroupUUID().equals(securityGroupUuid)) { LOG.debug("getVMListForSecurityGroup : adding ports with ips {} " + "compute port", neutronPort.getFixedIPs()); if (neutronPort.getFixedIPs() != null) { vmListForSecurityGroup.addAll(neutronPort.getFixedIPs());
if (port.getFixedIPs() == null) { continue; for (Neutron_IPs vmIp : port.getFixedIPs()) { securityServicesManager.syncSecurityRule(cachedport, securityRule, vmIp, false);
/** * Look up in the NeutronPortsCRUD cache and return the MAC address for a corresponding IP address * @param neutronPortsCache Reference to port cache to get existing port related data. This interface * basically read data from the md-sal data store. * @param subnetID subnet to which given port is attached * @param ipAddr IP address of a member or VM * @return MAC address registered with that IP address */ public static String getMacAddress(INeutronPortCRUD neutronPortsCache, String subnetID, String ipAddr) { if (ipAddr == null || subnetID == null) { return null; } List<NeutronPort> allPorts = neutronPortsCache.getAllPorts(); for (NeutronPort port : allPorts) { List<Neutron_IPs> fixedIPs = port.getFixedIPs(); if (fixedIPs != null && !fixedIPs.isEmpty()) { for (Neutron_IPs ip : fixedIPs) { if (ip.getIpAddress().equals(ipAddr) && ip.getSubnetUUID().equals(subnetID)) { return port.getMacAddress(); } } } } return null; }
@Override public List<Neutron_IPs> getIpAddressList(OvsdbTerminationPointAugmentation terminationPointAugmentation) { if (neutronPortCache == null) { LOG.warn("getIpAddress: neutronPortCache is null"); } NeutronPort neutronPort = null; LOG.trace("getIpAddress: for {}", terminationPointAugmentation.getName()); String neutronPortId = southbound.getInterfaceExternalIdsValue(terminationPointAugmentation, Constants.EXTERNAL_ID_INTERFACE_ID); if (neutronPortId == null) { return null; } if (neutronPortCache != null) { neutronPort = neutronPortCache.getPort(neutronPortId); } if (neutronPort == null) { neutronPort = getNeutronPortFromCache(terminationPointAugmentation); } if (neutronPort == null) { LOG.error("getIpAddress: neutron port of {} is not found", neutronPortId); return null; } return neutronPort.getFixedIPs(); }
List<Neutron_IPs> neutronPortFixedIp = neutronPort.getFixedIPs(); if (null == neutronPortFixedIp || neutronPortFixedIp.isEmpty()) { return false; if (null != port && !(port.getID().equals(neutronPort.getID())) && port.getDeviceOwner().contains("compute")) { List<Neutron_IPs> portFixedIp = port.getFixedIPs(); if (null == portFixedIp || portFixedIp.isEmpty()) { return false; .equals(neutronPort.getFixedIPs().iterator().next().getSubnetUUID())) { LOG.trace("isLastPortinSubnet: Port is not the only port."); return false;
continue; if (neutronPort.getFixedIPs() == null) { continue; for (Neutron_IPs neutronIP : neutronPort.getFixedIPs()) { final String tenantIpStr = neutronIP.getIpAddress(); if (tenantIpStr.isEmpty()) {
List<Neutron_IPs> fixedIps = neutronPort.getFixedIPs(); if (null == fixedIps || 0 == fixedIps.size() ) { LOG.error("getDHCPServerPort: No fixed ip is assigned");
if (neutronPort.getFixedIPs() != null) { for (Neutron_IPs neutronIP : neutronPort.getFixedIPs()) { if (neutronRouterInterface.getSubnetUUID().equalsIgnoreCase(neutronIP.getSubnetUUID())) { currPortShouldBeDeleted = true;
gatewayPort.getFixedIPs() != null) { LOG.info("Trigger MAC resolution for gateway ip {}", externalSubnet.getGatewayIP()); Neutron_IPs neutronIP = null; for (Neutron_IPs nIP : gatewayPort.getFixedIPs()) { InetAddress ipAddress; try { gatewayPort.getFixedIPs()); } else { gatewayMacResolver.resolveMacAddress(
List<Neutron_IPs> fixedIps = neutronPort.getFixedIPs(); if((null == fixedIps || fixedIps.isEmpty()) && actionToPerform == Action.DELETE && isDhcpPort){ List<Neutron_IPs> network_Ips = neutronPort.getFixedIPs(); for (Node node : nodes) { continue; for (Neutron_IPs neutronIPAddr : port.getFixedIPs()) { final String portIPAddress = neutronIPAddr.getIpAddress(); if (null == portIPAddress || portIPAddress.isEmpty()) {
final NeutronPort sourceNeutronPort = neutronPortCache.getPort(srcNeutronRouterInterface.getPortUUID()); final String macAddress2 = sourceNeutronPort != null ? sourceNeutronPort.getMacAddress() : null; final List<Neutron_IPs> ipList2 = sourceNeutronPort != null ? sourceNeutronPort.getFixedIPs() : null; final String cidr2 = sourceSubnet.getCidr(); final int mask2 = getMaskLenFromCidr(cidr2);
ans.setFixedIPs(new ArrayList<>(this.getFixedIPs()));
List<Neutron_IPs> ipList = neutronPort != null ? neutronPort.getFixedIPs() : null; final NeutronSubnet subnet = neutronSubnetCache.getSubnet(destNeutronRouterInterface.getSubnetUUID()); final NeutronNetwork neutronNetwork = subnet != null ?
result.setGatewayIP(String.valueOf(subnet.getGatewayIp().getValue())); if (port.getFixedIPs() != null) { for (Neutron_IPs ip : port.getFixedIPs()) { if (ip.getSubnetUUID().equals(result.getID())) { allPorts.add(port);
neutronPort.getDeviceOwner().equalsIgnoreCase(OWNER_ROUTER_INTERFACE_DISTRIBUTED)) { if (neutronPort.getFixedIPs() != null) { for (Neutron_IPs neutronIP : neutronPort.getFixedIPs()) { NeutronRouter_Interface neutronRouterInterface = new NeutronRouter_Interface(neutronIP.getSubnetUUID(), neutronPort.getPortUUID()); if (!isDelete && neutronPort.getFixedIPs() != null) { for (Neutron_IPs neutronIP : neutronPort.getFixedIPs()) { NeutronRouter_Interface neutronRouterInterface = subnetIdToRouterInterfaceCache.get(neutronIP.getSubnetUUID());
INeutronPortCRUD portIf = interfaces.getPortInterface(); for (NeutronPort port : portIf.getAllPorts()) { if (port.getFixedIPs() != null) { for (Neutron_IPs ip : port.getFixedIPs()) { if (ip.getSubnetUUID().equals(result.getID())) { allPorts.add(port);
if (neutronPort.getFixedIPs() != null) { List<FixedIps> listNeutronIPs = new ArrayList<>(); for (Neutron_IPs neutron_IPs : neutronPort.getFixedIPs()) { FixedIpsBuilder fixedIpsBuilder = new FixedIpsBuilder(); fixedIpsBuilder.setIpAddress(new IpAddress(neutron_IPs.getIpAddress().toCharArray()));