Search in sources :

Example 1 with RemoveFibEntryOutputBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.fib.rpc.rev160121.RemoveFibEntryOutputBuilder in project netvirt by opendaylight.

the class FibRpcServiceImpl method removeFibEntry.

/**
 * To remove FIB/LFIB/TST routes from specified dpn.
 */
@Override
public ListenableFuture<RpcResult<RemoveFibEntryOutput>> removeFibEntry(RemoveFibEntryInput input) {
    Uint64 dpnId = input.getSourceDpid();
    String vpnName = input.getVpnName();
    Uint32 vpnId = getVpnId(dataBroker, vpnName);
    String vpnRd = getVpnRd(dataBroker, vpnName);
    String ipAddress = input.getIpAddress();
    LOG.info("Delete custom FIB entry - {} on dpn {} for VPN {} ", ipAddress, dpnId, vpnName);
    LOG.info("REMOVE: Removing Custom Fib Entry rd {} prefix {} label {}", vpnRd, ipAddress, input.getServiceId());
    removeLocalFibEntry(dpnId, vpnId, ipAddress);
    IpAddresses.IpAddressSource ipAddressSource = IpAddresses.IpAddressSource.forValue(input.getIpAddressSource().getIntValue());
    vpnFootprintService.updateVpnToDpnMapping(dpnId, vpnName, vpnRd, null, /* interfaceName*/
    new ImmutablePair<>(ipAddressSource, ipAddress), false);
    LOG.info("REMOVE: Removed Custom Fib Entry rd {} prefix {} label {}", vpnRd, ipAddress, input.getServiceId());
    return RpcResultBuilder.success(new RemoveFibEntryOutputBuilder().build()).buildFuture();
}
Also used : IpAddresses(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.vpn.instance.op.data.vpn.instance.op.data.entry.vpn.to.dpn.list.IpAddresses) RemoveFibEntryOutputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.fib.rpc.rev160121.RemoveFibEntryOutputBuilder) Uint32(org.opendaylight.yangtools.yang.common.Uint32) Uint64(org.opendaylight.yangtools.yang.common.Uint64)

Aggregations

RemoveFibEntryOutputBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.fib.rpc.rev160121.RemoveFibEntryOutputBuilder)1 IpAddresses (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.vpn.instance.op.data.vpn.instance.op.data.entry.vpn.to.dpn.list.IpAddresses)1 Uint32 (org.opendaylight.yangtools.yang.common.Uint32)1 Uint64 (org.opendaylight.yangtools.yang.common.Uint64)1