resultBld.withResult(output.build()) ;
} else {
List<DPNTEPsInfo> meshedDpnList = ItmUtils.getTunnelMeshInfo(dataBroker);
+ if(meshedDpnList == null){
+ LOG.error("There are no tunnel mesh info in config DS");
+ return Futures.immediateFuture(resultBld.build());
+ }
// Look for external tunnels if not look for internal tunnel
for (DPNTEPsInfo teps : meshedDpnList) {
TunnelEndPoints firstEndPt = teps.getTunnelEndPoints().get(0);
TunnelList.class)
.child(InternalTunnel.class, new InternalTunnelKey(teps.getDPNID(), srcDpn, input.getTunnelType()));
- Optional<InternalTunnel>
- tnl =
- ItmUtils.read(LogicalDatastoreType.CONFIGURATION, path, dataBroker);
+ Optional<InternalTunnel> tnl = ItmUtils.read(LogicalDatastoreType.CONFIGURATION, path, dataBroker);
if (tnl != null && tnl.isPresent()) {
InternalTunnel tunnel = tnl.get();
GetInternalOrExternalInterfaceNameOutputBuilder
resultBld = RpcResultBuilder.success();
resultBld.withResult(output.build());
break;
+ }else{
+ LOG.error("Tunnel not found for source DPN {} ans destination IP {}", srcDpn, dstIp);
}
}
}
return Futures.immediateFuture(resultBld.build());
}
+ @Override
+ public Future<RpcResult<IsDcgwPresentOutput>> isDcgwPresent(IsDcgwPresentInput input) {
+ RpcResultBuilder<IsDcgwPresentOutput> resultBld = RpcResultBuilder.success();
+
+ List<DcGatewayIp> dcGatewayIpList = ItmUtils.getDcGatewayIpList(dataBroker);
+ String dcgwIpStr = input.getDcgwIp();
+ IpAddress dcgwIpAddr = new IpAddress(dcgwIpStr.toCharArray());
+ long retVal;
+
+ if((dcGatewayIpList != null) &&
+ (!dcGatewayIpList.isEmpty()) &&
+ (dcGatewayIpList.contains(dcgwIpAddr))) {
+ //Match found
+ retVal = 1;
+ IsDcgwPresentOutputBuilder output = new IsDcgwPresentOutputBuilder().setRetVal(retVal);
+ resultBld.withResult(output.build());
+ } else {
+ //Match not found
+ retVal = 2;
+ IsDcgwPresentOutputBuilder output = new IsDcgwPresentOutputBuilder().setRetVal(retVal);
+ resultBld.withResult(output.build());
+ }
+ return Futures.immediateFuture(resultBld.build());
+ }
+
}