summaryrefslogtreecommitdiffstats
path: root/l3
diff options
context:
space:
mode:
authorMarek Gradzki <mgradzki@cisco.com>2018-07-03 14:09:36 +0200
committerMarek Gradzki <mgradzki@cisco.com>2018-07-04 10:57:22 +0000
commitba6e99e27e2a54bd448c491e22a4e3fc26f45df6 (patch)
treecc1b29773b67280d79530715336c00b669a88f81 /l3
parentb6ead1d5525b5b1500729959acbce905bbcbf04a (diff)
HC2VPP-79: use AddressTranslator for ip-address-no-zone translation
Change-Id: I46955630709e3d837f95f488cb2fe089952865c4 Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
Diffstat (limited to 'l3')
-rw-r--r--l3/impl/src/main/java/io/fd/hc2vpp/l3/write/ipv4/ProxyRangeCustomizer.java16
1 files changed, 7 insertions, 9 deletions
diff --git a/l3/impl/src/main/java/io/fd/hc2vpp/l3/write/ipv4/ProxyRangeCustomizer.java b/l3/impl/src/main/java/io/fd/hc2vpp/l3/write/ipv4/ProxyRangeCustomizer.java
index 8c55df046..111e32296 100644
--- a/l3/impl/src/main/java/io/fd/hc2vpp/l3/write/ipv4/ProxyRangeCustomizer.java
+++ b/l3/impl/src/main/java/io/fd/hc2vpp/l3/write/ipv4/ProxyRangeCustomizer.java
@@ -16,8 +16,8 @@
package io.fd.hc2vpp.l3.write.ipv4;
-import com.google.common.net.InetAddresses;
import io.fd.hc2vpp.common.translate.util.FutureJVppCustomizer;
+import io.fd.hc2vpp.common.translate.util.Ipv4Translator;
import io.fd.hc2vpp.common.translate.util.JvppReplyConsumer;
import io.fd.honeycomb.translate.spi.write.ListWriterCustomizer;
import io.fd.honeycomb.translate.write.WriteContext;
@@ -26,9 +26,9 @@ import io.fd.vpp.jvpp.core.dto.ProxyArpAddDel;
import io.fd.vpp.jvpp.core.dto.ProxyArpAddDelReply;
import io.fd.vpp.jvpp.core.future.FutureJVppCore;
import io.fd.vpp.jvpp.core.types.ProxyArp;
-import java.net.InetAddress;
import java.util.concurrent.Future;
import javax.annotation.Nonnull;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4AddressNoZone;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.proxy.arp.rev180703.proxy.ranges.ProxyRange;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.proxy.arp.rev180703.proxy.ranges.ProxyRangeKey;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
@@ -62,11 +62,9 @@ public class ProxyRangeCustomizer extends FutureJVppCustomizer
private Future<ProxyArpAddDelReply> getProxyArpRequestFuture(ProxyRange proxyArp, byte operation)
throws WriteFailedException {
- final InetAddress srcAddress = InetAddresses.forString(proxyArp.getLowAddr().getValue());
- final InetAddress dstAddress = InetAddresses.forString(proxyArp.getHighAddr().getValue());
final int vrfId = proxyArp.getVrfId().getValue().intValue();
return getFutureJVpp().proxyArpAddDel(
- getProxyArpConfRequest(operation, srcAddress.getAddress(), dstAddress.getAddress(), vrfId))
+ getProxyArpConfRequest(operation, proxyArp.getLowAddr(), proxyArp.getHighAddr(), vrfId))
.toCompletableFuture();
}
@@ -85,13 +83,13 @@ public class ProxyRangeCustomizer extends FutureJVppCustomizer
LOG.debug("Proxy ARP setting delete successful, with reply context:", reply.context);
}
- private static ProxyArpAddDel getProxyArpConfRequest(final byte isAdd, final byte[] lAddr, final byte[] hAddr,
- final int vrfId) {
+ private static ProxyArpAddDel getProxyArpConfRequest(final byte isAdd, final Ipv4AddressNoZone lAddr,
+ final Ipv4AddressNoZone hAddr, final int vrfId) {
final ProxyArpAddDel proxyArpAddDel = new ProxyArpAddDel();
proxyArpAddDel.isAdd = isAdd;
proxyArpAddDel.proxy = new ProxyArp();
- proxyArpAddDel.proxy.lowAddress = lAddr;
- proxyArpAddDel.proxy.hiAddress = hAddr;
+ proxyArpAddDel.proxy.lowAddress = Ipv4Translator.INSTANCE.ipv4AddressNoZoneToArray(lAddr);
+ proxyArpAddDel.proxy.hiAddress = Ipv4Translator.INSTANCE.ipv4AddressNoZoneToArray(hAddr);
proxyArpAddDel.proxy.vrfId = vrfId;
return proxyArpAddDel;
}