diff options
Diffstat (limited to 'v3po/v3po2vpp/src/main')
-rw-r--r-- | v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfaces/RoutingCustomizer.java | 9 | ||||
-rw-r--r-- | v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfacesstate/RoutingCustomizer.java | 9 |
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))); } } } |