use of org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.fib.rpc.rev160121.CreateFibEntryOutputBuilder in project netvirt by opendaylight.
the class FibRpcServiceImpl method createFibEntry.
/**
* To install FIB routes on specified dpn with given instructions.
*/
@Override
public ListenableFuture<RpcResult<CreateFibEntryOutput>> createFibEntry(CreateFibEntryInput input) {
Uint64 dpnId = input.getSourceDpid();
String vpnName = input.getVpnName();
String vpnRd = getVpnRd(dataBroker, vpnName);
String ipAddress = input.getIpAddress();
LOG.info("Create custom FIB entry - {} on dpn {} for VPN {} ", ipAddress, dpnId, vpnName);
Map<InstructionKey, Instruction> instructionMap = input.nonnullInstruction();
LOG.info("ADD: Adding Custom Fib Entry rd {} prefix {} label {}", vpnRd, ipAddress, input.getServiceId());
IpAddresses.IpAddressSource ipAddressSource = IpAddresses.IpAddressSource.forValue(input.getIpAddressSource().getIntValue());
vpnFootprintService.updateVpnToDpnMapping(dpnId, vpnName, vpnRd, null, /* interfaceName*/
new ImmutablePair<>(ipAddressSource, ipAddress), true);
Uint32 vpnId = getVpnId(dataBroker, vpnName);
makeLocalFibEntry(vpnId, dpnId, ipAddress, new ArrayList<Instruction>(instructionMap.values()));
LOG.info("ADD: Added Custom Fib Entry rd {} prefix {} label {}", vpnRd, ipAddress, input.getServiceId());
return RpcResultBuilder.success(new CreateFibEntryOutputBuilder().build()).buildFuture();
}
Aggregations