summaryrefslogtreecommitdiffstats
path: root/v3po/v3po2vpp/src/main/java/io/fd
diff options
context:
space:
mode:
authorMarek Gradzki <mgradzki@cisco.com>2018-07-03 09:56:58 +0200
committerMarek Gradzki <mgradzki@cisco.com>2018-07-03 10:38:42 +0200
commite5768e2dd1721bd454d2ddbd4e6dc647a5daebe5 (patch)
tree28e4feaf4354cedc17fcb691c9ac639391315d13 /v3po/v3po2vpp/src/main/java/io/fd
parentec365fe22b9f52fce8daa667c0f0fa9cc25e64f6 (diff)
HC2VPP-346: use fib-table-list-ref for FIB to ifc assignment
Change-Id: Ie57776ab9784b7c57630b7ea9ce9b96b71feb5a5 Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
Diffstat (limited to 'v3po/v3po2vpp/src/main/java/io/fd')
-rw-r--r--v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfaces/RoutingCustomizer.java9
-rw-r--r--v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfacesstate/RoutingCustomizer.java9
2 files changed, 10 insertions, 8 deletions
diff --git a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfaces/RoutingCustomizer.java b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfaces/RoutingCustomizer.java
index fb5ec3371..1f8e2364b 100644
--- a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfaces/RoutingCustomizer.java
+++ b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfaces/RoutingCustomizer.java
@@ -30,6 +30,7 @@ import io.fd.vpp.jvpp.core.future.FutureJVppCore;
import java.util.concurrent.CompletionStage;
import javax.annotation.Nonnull;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev170607.RoutingBaseAttributes;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.fib.table.management.rev180521.VniReference;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -59,13 +60,13 @@ abstract class RoutingCustomizer extends FutureJVppCustomizer implements JvppRep
}
private void setVrfId(final InstanceIdentifier<? extends RoutingBaseAttributes> id, final int swIfc,
- final Long vrfId, boolean isIp6)
+ final VniReference vniRef, boolean isIp6)
throws WriteFailedException {
- if (vrfId == null) {
+ if (vniRef == null || vniRef.getValue() == null) {
return;
}
- final CompletionStage<SwInterfaceSetTableReply> cs = getFutureJVpp()
- .swInterfaceSetTable(getInterfaceSetTableRequest(swIfc, booleanToByte(isIp6), vrfId.intValue()));
+ final CompletionStage<SwInterfaceSetTableReply> cs = getFutureJVpp().swInterfaceSetTable(
+ getInterfaceSetTableRequest(swIfc, booleanToByte(isIp6), vniRef.getValue().intValue()));
getReplyForWrite(cs.toCompletableFuture(), id);
}
diff --git a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfacesstate/RoutingCustomizer.java b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfacesstate/RoutingCustomizer.java
index 58603c742..9727c4d35 100644
--- a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfacesstate/RoutingCustomizer.java
+++ b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfacesstate/RoutingCustomizer.java
@@ -28,6 +28,7 @@ import io.fd.vpp.jvpp.core.future.FutureJVppCore;
import java.util.function.Consumer;
import javax.annotation.Nonnull;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev170607.RoutingBaseAttributes;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.fib.table.management.rev180521.VniReference;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
abstract class RoutingCustomizer extends FutureJVppCustomizer implements JvppReplyConsumer {
@@ -40,8 +41,8 @@ abstract class RoutingCustomizer extends FutureJVppCustomizer implements JvppRep
}
protected void readInterfaceRouting(@Nonnull final InstanceIdentifier<? extends RoutingBaseAttributes> id,
- @Nonnull final Consumer<Long> v4VrfConsumer,
- @Nonnull final Consumer<Long> v6VrfConsumer,
+ @Nonnull final Consumer<VniReference> v4VrfConsumer,
+ @Nonnull final Consumer<VniReference> v6VrfConsumer,
@Nonnull final ReadContext ctx, final String interfaceName)
throws ReadFailedException {
final SwInterfaceGetTable request = new SwInterfaceGetTable();
@@ -55,10 +56,10 @@ abstract class RoutingCustomizer extends FutureJVppCustomizer implements JvppRep
getReplyForRead(getFutureJVpp().swInterfaceGetTable(request).toCompletableFuture(), id);
if (ip4Reply.vrfId != 0) {
- v4VrfConsumer.accept(UnsignedInts.toLong(ip4Reply.vrfId));
+ v4VrfConsumer.accept(new VniReference(UnsignedInts.toLong(ip4Reply.vrfId)));
}
if (ip6Reply.vrfId != 0) {
- v6VrfConsumer.accept(UnsignedInts.toLong(ip6Reply.vrfId));
+ v6VrfConsumer.accept(new VniReference(UnsignedInts.toLong(ip6Reply.vrfId)));
}
}
}