/** * 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; }
String ipaddress = null; if (null != vmIp) { ipaddress = vmIp.getIpAddress(); try { InetAddress address = InetAddress.getByName(vmIp.getIpAddress()); if (isIpv6 && address instanceof Inet4Address || !isIpv6 && address instanceof Inet6Address) { LOG.debug("programPortSecurityRule: Remote vmIP {} does not match "
String ipaddress = null; if (null != vmIp) { ipaddress = vmIp.getIpAddress(); try { InetAddress address = InetAddress.getByName(ipaddress);
final String tenantIpStr = neutronIP.getIpAddress(); if (tenantIpStr.isEmpty()) { continue;
final String ipStr2 = neutronIP2.getIpAddress(); if (ipStr2.isEmpty()) { continue;
InetAddress ipAddress; try { ipAddress = InetAddress.getByName(nIP.getIpAddress()); } catch (UnknownHostException e) { LOG.warn("unknown host exception {}", e); new Ipv4Address(neutronIP.getIpAddress()), new MacAddress(gatewayPort.getMacAddress()), true /* periodicRefresh */);
final String ipAddress = neutronIP.getIpAddress(); if (ipAddress.isEmpty()) { continue; final String portIPAddress = neutronIPAddr.getIpAddress(); if (null == portIPAddress || portIPAddress.isEmpty()) { continue;
final String ipStr = neutronIP.getIpAddress(); if (ipStr.isEmpty()) { LOG.debug("programFlowsForNeutronRouterInterface is skipping node {} ip {}",
for (Neutron_IPs eIP : externalGatewayInfos.getExternalFixedIPs()) { ExternalFixedIpsBuilder eFixedIpBuilder = new ExternalFixedIpsBuilder(); eFixedIpBuilder.setIpAddress(new IpAddress(eIP.getIpAddress().toCharArray())); eFixedIpBuilder.setSubnetId(toUuid(eIP.getSubnetUUID())); externalFixedIps.add(eFixedIpBuilder.build());
for (Neutron_IPs neutron_IPs : neutronPort.getFixedIPs()) { FixedIpsBuilder fixedIpsBuilder = new FixedIpsBuilder(); fixedIpsBuilder.setIpAddress(new IpAddress(neutron_IPs.getIpAddress().toCharArray())); fixedIpsBuilder.setSubnetId(toUuid(neutron_IPs.getSubnetUUID())); listNeutronIPs.add(fixedIpsBuilder.build());