From f9acfac8b701f9903a28edc98db127c36d73384f Mon Sep 17 00:00:00 2001 From: Michal Cmarada Date: Mon, 12 Nov 2018 13:35:06 +0100 Subject: Bump jvpp version to 19.01-SNAPSHOT Also sets version of VPP package dependencies to 19.01. - fixes several changes made in VPP API Change-Id: Icca406f414bce30745026573c78a69eea09dc566 Signed-off-by: Michal Cmarada --- .../interfacesstate/InterfaceDataTranslator.java | 31 +++------------------- .../l2/ArpTerminationTableEntryCustomizer.java | 19 +++++++++---- 2 files changed, 18 insertions(+), 32 deletions(-) (limited to 'v3po/v3po2vpp/src/main') diff --git a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfacesstate/InterfaceDataTranslator.java b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfacesstate/InterfaceDataTranslator.java index 188f83d0f..666fa31fa 100644 --- a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfacesstate/InterfaceDataTranslator.java +++ b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfacesstate/InterfaceDataTranslator.java @@ -49,42 +49,19 @@ public interface InterfaceDataTranslator extends ByteDataTranslator, JvppReplyCo InterfaceDataTranslator INSTANCE = new InterfaceDataTranslator() { }; - Gauge64 vppLinkSpeed0 = new Gauge64(BigInteger.ZERO); - Gauge64 vppLinkSpeed1 = new Gauge64(BigInteger.valueOf(10L * 1000000)); - Gauge64 vppLinkSpeed2 = new Gauge64(BigInteger.valueOf(100L * 1000000)); - Gauge64 vppLinkSpeed4 = new Gauge64(BigInteger.valueOf(1000L * 1000000)); - Gauge64 vppLinkSpeed8 = new Gauge64(BigInteger.valueOf(10000L * 1000000)); - Gauge64 vppLinkSpeed16 = new Gauge64(BigInteger.valueOf(40000L * 1000000)); - Gauge64 vppLinkSpeed32 = new Gauge64(BigInteger.valueOf(100000L * 1000000)); - int PHYSICAL_ADDRESS_LENGTH = 6; Collector SINGLE_ITEM_COLLECTOR = RWUtils.singleItemCollector(); /** - * Convert VPP's link speed bitmask to Yang type. 1 = 10M, 2 = 100M, 4 = 1G, 8 = 10G, 16 = 40G, 32 = 100G + * Convert VPP's link speed in kbits per second to Yang type. * - * @param vppLinkSpeed Link speed in bitmask format from VPP. + * @param vppLinkSpeed Link speed in kbits per second from VPP. * @return Converted value from VPP link speed */ - default Gauge64 vppInterfaceSpeedToYang(byte vppLinkSpeed) { - switch (vppLinkSpeed) { - case 1: - return vppLinkSpeed1; - case 2: - return vppLinkSpeed2; - case 4: - return vppLinkSpeed4; - case 8: - return vppLinkSpeed8; - case 16: - return vppLinkSpeed16; - case 32: - return vppLinkSpeed32; - default: - return vppLinkSpeed0; - } + default Gauge64 vppInterfaceSpeedToYang(int vppLinkSpeed) { + return new Gauge64(BigInteger.valueOf(Integer.toUnsignedLong(vppLinkSpeed) * 1000)); } /** diff --git a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/l2/ArpTerminationTableEntryCustomizer.java b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/l2/ArpTerminationTableEntryCustomizer.java index fc0aba36d..2e13ecc01 100644 --- a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/l2/ArpTerminationTableEntryCustomizer.java +++ b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/l2/ArpTerminationTableEntryCustomizer.java @@ -28,6 +28,11 @@ import io.fd.honeycomb.translate.write.WriteFailedException; import io.fd.vpp.jvpp.core.dto.BdIpMacAddDel; import io.fd.vpp.jvpp.core.dto.BdIpMacAddDelReply; import io.fd.vpp.jvpp.core.future.FutureJVppCore; +import io.fd.vpp.jvpp.core.types.Address; +import io.fd.vpp.jvpp.core.types.AddressFamily; +import io.fd.vpp.jvpp.core.types.AddressUnion; +import io.fd.vpp.jvpp.core.types.Ip4Address; +import io.fd.vpp.jvpp.core.types.MacAddress; import java.util.concurrent.CompletionStage; import javax.annotation.Nonnull; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddressNoZone; @@ -94,12 +99,16 @@ public class ArpTerminationTableEntryCustomizer extends FutureJVppCustomizer final BdIpMacAddDel request = new BdIpMacAddDel(); request.bdId = bdId; request.isAdd = booleanToByte(isAdd); - request.macAddress = parseMac(entry.getPhysAddress().getValue()); - + MacAddress macAddress = new MacAddress(); + macAddress.bytes = parseMac(entry.getPhysAddress().getValue()); + request.mac = macAddress; final IpAddressNoZone ipAddress = entry.getIpAddress(); - - request.ipAddress = ipAddressToArray(ipAddress); - request.isIpv6 = booleanToByte(isIpv6(ipAddress)); + Ip4Address ip4Address = new Ip4Address(); + ip4Address.address = ipAddressToArray(ipAddress); + Address address = new Address(); + address.af = AddressFamily.ADDRESS_IP4; + address.un = new AddressUnion(ip4Address); + request.ip = address; return request; } -- cgit 1.2.3-korg