Search in sources :

Example 6 with ArpReponderInputBuilder

use of org.opendaylight.netvirt.elan.arp.responder.ArpResponderInput.ArpReponderInputBuilder in project netvirt by opendaylight.

the class ArpResponderHandler method removeArpResponderFlow.

/**
 * Remove ARP Responder flow when VM interface is removed, by invoking ELan
 * RPC service.
 *
 * @param dpId
 *            dpn Id on which ARP responder flow to be removed
 * @param lportTag
 *            lport tag of the interface
 * @param ifName
 *            interface to which ARP responder flow to be removed
 * @param gatewayIp
 *            subnet gateway ip
 * @param subnetUuid
 *            subnet Id of the interface
 */
public void removeArpResponderFlow(BigInteger dpId, int lportTag, String ifName, String gatewayIp, Uuid subnetUuid) {
    if (gatewayIp == null) {
        Optional<String> gwIpOptional = VpnUtil.getVpnSubnetGatewayIp(dataBroker, subnetUuid);
        if (gwIpOptional.isPresent()) {
            gatewayIp = gwIpOptional.get();
        }
    }
    if (gatewayIp != null) {
        ArpReponderInputBuilder builder = new ArpReponderInputBuilder();
        builder.setDpId(dpId).setInterfaceName(ifName).setSpa(gatewayIp).setLportTag(lportTag);
        elanService.removeArpResponderFlow(builder.buildForRemoveFlow());
    }
}
Also used : ArpReponderInputBuilder(org.opendaylight.netvirt.elan.arp.responder.ArpResponderInput.ArpReponderInputBuilder)

Aggregations

ArpReponderInputBuilder (org.opendaylight.netvirt.elan.arp.responder.ArpResponderInput.ArpReponderInputBuilder)6 ArrayList (java.util.ArrayList)2 ListenableFuture (com.google.common.util.concurrent.ListenableFuture)1 BigInteger (java.math.BigInteger)1 Collections (java.util.Collections)1 List (java.util.List)1 Callable (java.util.concurrent.Callable)1 DataBroker (org.opendaylight.controller.md.sal.binding.api.DataBroker)1 ManagedNewTransactionRunner (org.opendaylight.genius.infra.ManagedNewTransactionRunner)1 ManagedNewTransactionRunnerImpl (org.opendaylight.genius.infra.ManagedNewTransactionRunnerImpl)1 IInterfaceManager (org.opendaylight.genius.interfacemanager.interfaces.IInterfaceManager)1 NwConstants (org.opendaylight.genius.mdsalutil.NwConstants)1 InstructionWriteMetadata (org.opendaylight.genius.mdsalutil.instructions.InstructionWriteMetadata)1 DhcpExternalTunnelManager (org.opendaylight.netvirt.dhcpservice.DhcpExternalTunnelManager)1 DhcpManager (org.opendaylight.netvirt.dhcpservice.DhcpManager)1 DhcpServiceUtils (org.opendaylight.netvirt.dhcpservice.DhcpServiceUtils)1 DhcpMConstants (org.opendaylight.netvirt.dhcpservice.api.DhcpMConstants)1 ArpResponderInput (org.opendaylight.netvirt.elan.arp.responder.ArpResponderInput)1 ArpResponderUtil (org.opendaylight.netvirt.elan.arp.responder.ArpResponderUtil)1 IElanService (org.opendaylight.netvirt.elanmanager.api.IElanService)1