--- /dev/null
+/*
+ * Copyright © 2018 Ericsson India Global Services Pvt Ltd. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.genius.testutils;
+
+import org.opendaylight.genius.itm.api.IITMProvider;
+import org.opendaylight.infrautils.testutils.Partials;
+
+public abstract class TestItmProvider implements IITMProvider {
+
+ public static IITMProvider newInstance() {
+ return Partials.newPartial(IITMProvider.class);
+ }
+}
BigInteger destinationDpn = input.getDestinationDpid();
Optional<InternalTunnel> optTunnel = Optional.absent();
+ if (interfaceManager.isItmDirectTunnelsEnabled()) {
+ DpnTepInterfaceInfo interfaceInfo = dpnTepStateCache.getDpnTepInterface(sourceDpn, destinationDpn);
+ if (interfaceInfo != null) {
+ resultBld = RpcResultBuilder.success();
+ resultBld.withResult(new GetTunnelInterfaceNameOutputBuilder()
+ .setInterfaceName(interfaceInfo.getTunnelName())).build();
+ return Futures.immediateFuture(resultBld.build());
+ }
+ }
if (ItmUtils.isTunnelAggregationUsed(input.getTunnelType())) {
optTunnel = ItmUtils.getInternalTunnelFromDS(sourceDpn, destinationDpn,
TunnelTypeLogicalGroup.class, dataBroker);
.withError(RpcError.ErrorType.APPLICATION,
"tunnel name not set for GetEgressActionsForTunnel call").build());
}
-
- if (!dpnTepStateCache.isInternal(tunnelName) && !interfaceManager.isItmDirectTunnelsEnabled()) {
+ if (!dpnTepStateCache.isInternal(tunnelName) || !interfaceManager.isItmDirectTunnelsEnabled()) {
// Re-direct the RPC to Interface Manager
// From the rpc input and get the output and copy to output
org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.rpcs.rev160406
TunnelEndPoints firstEndPt = teps.getTunnelEndPoints().get(0);
if (dstIp.equals(firstEndPt.getIpAddress())) {
Optional<InternalTunnel> optTunnel = Optional.absent();
+ if (interfaceManager.isItmDirectTunnelsEnabled()) {
+ DpnTepInterfaceInfo interfaceInfo =
+ dpnTepStateCache.getDpnTepInterface(srcDpn, teps.getDPNID());
+ if (interfaceInfo != null) {
+ resultBld = RpcResultBuilder.success();
+ resultBld.withResult(new GetInternalOrExternalInterfaceNameOutputBuilder()
+ .setInterfaceName(interfaceInfo.getTunnelName())).build();
+ return Futures.immediateFuture(resultBld.build());
+ }
+ }
+
if (ItmUtils.isTunnelAggregationUsed(input.getTunnelType())) {
optTunnel = ItmUtils.getInternalTunnelFromDS(srcDpn, teps.getDPNID(),
TunnelTypeLogicalGroup.class, dataBroker);