diff options
author | 2018-07-02 13:09:26 +0200 | |
---|---|---|
committer | 2018-07-02 13:12:12 +0200 | |
commit | 99db0d333b6e7b101fb55c759f5a4ac028ee0d0b (patch) | |
tree | 95de1fa14a3ede56653ab429473d986c86236f00 /v3po/v3po2vpp/src/main/java/io | |
parent | c428881044008b3865c8e934dd53240b43c084f1 (diff) |
HC2VPP-346: use fib-table-list-ref for VXLAN configuration
User is required to explicitly configure FIB tables
using vpp-fib-management module.
The change does not require modification of RESTCONF and NETCONF requests.
Change-Id: Ie3cbff61281ba1a7a9e14c0a26cbd9ce6e44587f
Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
Diffstat (limited to 'v3po/v3po2vpp/src/main/java/io')
-rw-r--r-- | v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfaces/VxlanCustomizer.java | 8 | ||||
-rw-r--r-- | v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfacesstate/VxlanCustomizer.java | 4 |
2 files changed, 9 insertions, 3 deletions
diff --git a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfaces/VxlanCustomizer.java b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfaces/VxlanCustomizer.java index f21b0198f..97d300385 100644 --- a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfaces/VxlanCustomizer.java +++ b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfaces/VxlanCustomizer.java @@ -87,7 +87,9 @@ public class VxlanCustomizer extends AbstractInterfaceTypeCustomizer<Vxlan> impl final InetAddress srcAddress = InetAddresses.forString(getAddressString(vxlan.getSrc())); final InetAddress dstAddress = InetAddresses.forString(getAddressString(vxlan.getDst())); - int encapVrfId = vxlan.getEncapVrfId().intValue(); + checkArgument(vxlan.getEncapVrfId() != null && vxlan.getEncapVrfId().getValue() != null, + "encap-vrf-id is mandatory but was not given"); + int encapVrfId = vxlan.getEncapVrfId().getValue().intValue(); int vni = vxlan.getVni().getValue().intValue(); int decapNext = -1; @@ -157,7 +159,9 @@ public class VxlanCustomizer extends AbstractInterfaceTypeCustomizer<Vxlan> impl final InetAddress srcAddress = InetAddresses.forString(getAddressString(vxlan.getSrc())); final InetAddress dstAddress = InetAddresses.forString(getAddressString(vxlan.getDst())); - int encapVrfId = vxlan.getEncapVrfId().intValue(); + checkArgument(vxlan.getEncapVrfId() != null && vxlan.getEncapVrfId().getValue() != null, + "encap-vrf-id is mandatory but was not given"); + int encapVrfId = vxlan.getEncapVrfId().getValue().intValue(); int vni = vxlan.getVni().getValue().intValue(); int decapNext = -1; diff --git a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfacesstate/VxlanCustomizer.java b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfacesstate/VxlanCustomizer.java index dd9f84090..dac59d6f4 100644 --- a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfacesstate/VxlanCustomizer.java +++ b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfacesstate/VxlanCustomizer.java @@ -18,6 +18,7 @@ package io.fd.hc2vpp.v3po.interfacesstate; import static com.google.common.base.Preconditions.checkState; +import com.google.common.primitives.UnsignedInts; import io.fd.hc2vpp.common.translate.util.FutureJVppCustomizer; import io.fd.hc2vpp.common.translate.util.Ipv4Translator; import io.fd.hc2vpp.common.translate.util.Ipv6Translator; @@ -46,6 +47,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev170607.VxlanVni; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev170607.interfaces.state._interface.Vxlan; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev170607.interfaces.state._interface.VxlanBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.fib.table.management.rev180521.VniReference; import org.opendaylight.yangtools.concepts.Builder; import org.opendaylight.yangtools.yang.binding.DataObject; import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; @@ -123,7 +125,7 @@ public class VxlanCustomizer extends FutureJVppCustomizer builder.setDst(new IpAddress(arrayToIpv4AddressNoZone(swInterfaceVxlanDetails.dstAddress))); builder.setSrc(new IpAddress(arrayToIpv4AddressNoZone(swInterfaceVxlanDetails.srcAddress))); } - builder.setEncapVrfId((long) swInterfaceVxlanDetails.encapVrfId); + builder.setEncapVrfId(new VniReference(UnsignedInts.toLong(swInterfaceVxlanDetails.encapVrfId))); builder.setVni(new VxlanVni((long) swInterfaceVxlanDetails.vni)); switch (swInterfaceVxlanDetails.decapNextIndex) { case 1: |