use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.pcreq.message.pcreq.message.Requests in project netvirt by opendaylight.
the class ArpNotificationHandler method processArpLearning.
private void processArpLearning(String srcInterface, IpAddress srcIP, PhysAddress srcMac, BigInteger metadata, IpAddress dstIP) {
if (metadata != null && !Objects.equals(metadata, BigInteger.ZERO)) {
Optional<List<String>> vpnList = VpnUtil.getVpnHandlingIpv4AssociatedWithInterface(dataBroker, srcInterface);
if (vpnList.isPresent()) {
for (String vpnName : vpnList.get()) {
LOG.info("Received ARP for sender MAC {} and sender IP {} via interface {}", srcMac.getValue(), srcIP.getIpv4Address().getValue(), srcInterface);
String ipToQuery = srcIP.getIpv4Address().getValue();
LOG.info("ARP being processed for Source IP {}", ipToQuery);
VpnPortipToPort vpnPortipToPort = VpnUtil.getNeutronPortFromVpnPortFixedIp(dataBroker, vpnName, ipToQuery);
if (vpnPortipToPort != null) {
/* This is a well known neutron port and so should be ignored
* from being discovered
*/
continue;
}
LearntVpnVipToPort learntVpnVipToPort = VpnUtil.getLearntVpnVipToPort(dataBroker, vpnName, ipToQuery);
if (learntVpnVipToPort != null) {
String oldPortName = learntVpnVipToPort.getPortName();
String oldMac = learntVpnVipToPort.getMacAddress();
if (!oldMac.equalsIgnoreCase(srcMac.getValue())) {
// MAC has changed for requested IP
LOG.info("ARP Source IP/MAC data modified for IP {} with MAC {} and Port {}", ipToQuery, srcMac, srcInterface);
synchronized ((vpnName + ipToQuery).intern()) {
removeMipAdjacency(vpnName, oldPortName, srcIP);
VpnUtil.removeLearntVpnVipToPort(dataBroker, vpnName, ipToQuery);
putVpnIpToMigrateArpCache(vpnName, ipToQuery, srcMac);
}
}
} else if (!isIpInArpMigrateCache(vpnName, ipToQuery)) {
learnMacFromArpPackets(vpnName, srcInterface, srcIP, srcMac, dstIP);
}
}
} else {
LOG.info("ARP NO_RESOLVE: VPN not configured. Ignoring responding to ARP requests from this" + " Interface {}.", srcInterface);
return;
}
}
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.pcreq.message.pcreq.message.Requests in project netvirt by opendaylight.
the class NeutronSubnetGwMacResolver method sendArpRequestsToExtGatewayTask.
private void sendArpRequestsToExtGatewayTask(Router router) {
LOG.trace("Send ARP requests to external GW for router {}", router);
Port extPort = getRouterExtGatewayPort(router);
if (extPort == null) {
LOG.trace("External GW port for router {} is missing", router.getUuid().getValue());
return;
}
String extInterface = getExternalInterface(router);
if (extInterface == null) {
LOG.trace("No external interface defined for router {}", router.getUuid().getValue());
return;
}
List<FixedIps> fixedIps = extPort.getFixedIps();
if (fixedIps == null || fixedIps.isEmpty()) {
LOG.trace("External GW port {} for router {} has no fixed IPs", extPort.getUuid().getValue(), router.getUuid().getValue());
return;
}
MacAddress macAddress = extPort.getMacAddress();
if (macAddress == null) {
LOG.trace("External GW port {} for router {} has no mac address", extPort.getUuid().getValue(), router.getUuid().getValue());
return;
}
for (FixedIps fixIp : fixedIps) {
Uuid subnetId = fixIp.getSubnetId();
IpAddress srcIpAddress = fixIp.getIpAddress();
IpAddress dstIpAddress = getExternalGwIpAddress(subnetId);
sendArpRequest(srcIpAddress, dstIpAddress, macAddress, extInterface);
}
}
Aggregations