diff options
author | Michal Cmarada <mcmarada@cisco.com> | 2019-02-06 09:41:39 +0100 |
---|---|---|
committer | Michal Cmarada <mcmarada@cisco.com> | 2019-02-06 09:41:39 +0100 |
commit | 3751ef96ae1427cc8d5ecb9cbba705e837bb63ca (patch) | |
tree | 08c01465ea307e9eebcdf1e12990ebdb66961228 /l3/impl/src/main/java/io | |
parent | acf5a8a052e2f7f7c2b03c023df3dd489688cb00 (diff) |
fix after changes in VPP API
- fixes for mac adress
- fixes for ipaddress
- fixes refactoring in ipsec
Change-Id: Idc3e3557b72a5f1ac5b32b9738d90ca23ed6ed9e
Signed-off-by: Michal Cmarada <mcmarada@cisco.com>
Diffstat (limited to 'l3/impl/src/main/java/io')
11 files changed, 79 insertions, 62 deletions
diff --git a/l3/impl/src/main/java/io/fd/hc2vpp/l3/read/ipv4/Ipv4NeighbourCustomizer.java b/l3/impl/src/main/java/io/fd/hc2vpp/l3/read/ipv4/Ipv4NeighbourCustomizer.java index 48a2d5aed..1da148a31 100644 --- a/l3/impl/src/main/java/io/fd/hc2vpp/l3/read/ipv4/Ipv4NeighbourCustomizer.java +++ b/l3/impl/src/main/java/io/fd/hc2vpp/l3/read/ipv4/Ipv4NeighbourCustomizer.java @@ -30,6 +30,7 @@ import io.fd.honeycomb.translate.util.read.cache.DumpCacheManager.DumpCacheManag import io.fd.vpp.jvpp.core.dto.IpNeighborDetails; import io.fd.vpp.jvpp.core.dto.IpNeighborDetailsReplyDump; import io.fd.vpp.jvpp.core.future.FutureJVppCore; +import io.fd.vpp.jvpp.core.types.IpNeighborFlags; import java.util.List; import java.util.function.Function; import javax.annotation.Nonnull; @@ -74,12 +75,14 @@ public class Ipv4NeighbourCustomizer extends IpNeighbourReader if (dumpOpt.isPresent()) { dumpOpt.get().ipNeighborDetails .stream() - .filter(ipNeighborDetails -> ip.equals(arrayToIpv4AddressNoZone(ipNeighborDetails.ipAddress))) + .filter(ipNeighborDetails -> ip.equals(arrayToIpv4AddressNoZone( + ipNeighborDetails.neighbor.ipAddress.un.getIp4().ip4Address))) .findFirst() - .ifPresent(ipNeighborDetails -> builder.setIp(arrayToIpv4AddressNoZone(ipNeighborDetails.ipAddress)) + .ifPresent(ipNeighborDetails -> builder.setIp(arrayToIpv4AddressNoZone( + ipNeighborDetails.neighbor.ipAddress.un.getIp4().ip4Address)) .withKey(keyMapper().apply(ipNeighborDetails)) - .setLinkLayerAddress(toPhysAddress(ipNeighborDetails.macAddress)) - .setOrigin(ipNeighborDetails.isStatic == 0 + .setLinkLayerAddress(toPhysAddress(ipNeighborDetails.neighbor.macAddress.macaddress)) + .setOrigin(ipNeighborDetails.neighbor.flags != IpNeighborFlags.IP_API_NEIGHBOR_FLAG_STATIC ? Dynamic : Static)); } @@ -97,6 +100,7 @@ public class Ipv4NeighbourCustomizer extends IpNeighbourReader } private Function<IpNeighborDetails, NeighborKey> keyMapper() { - return ipNeighborDetails -> new NeighborKey(arrayToIpv4AddressNoZone(ipNeighborDetails.ipAddress)); + return ipNeighborDetails -> new NeighborKey( + arrayToIpv4AddressNoZone(ipNeighborDetails.neighbor.ipAddress.un.getIp4().ip4Address)); } }
\ No newline at end of file diff --git a/l3/impl/src/main/java/io/fd/hc2vpp/l3/read/ipv4/subinterface/SubInterfaceIpv4NeighbourCustomizer.java b/l3/impl/src/main/java/io/fd/hc2vpp/l3/read/ipv4/subinterface/SubInterfaceIpv4NeighbourCustomizer.java index 8e0267aca..c1c2f8559 100644 --- a/l3/impl/src/main/java/io/fd/hc2vpp/l3/read/ipv4/subinterface/SubInterfaceIpv4NeighbourCustomizer.java +++ b/l3/impl/src/main/java/io/fd/hc2vpp/l3/read/ipv4/subinterface/SubInterfaceIpv4NeighbourCustomizer.java @@ -67,11 +67,13 @@ public class SubInterfaceIpv4NeighbourCustomizer extends IpNeighbourReader if (dumpOpt.isPresent()) { dumpOpt.get().ipNeighborDetails .stream() - .filter(ipNeighborDetails -> ip.equals(arrayToIpv4AddressNoZone(ipNeighborDetails.ipAddress))) + .filter(ipNeighborDetails -> ip.equals(arrayToIpv4AddressNoZone( + ipNeighborDetails.neighbor.ipAddress.un.getIp4().ip4Address))) .findFirst() - .ifPresent(ipNeighborDetails -> builder.setIp(arrayToIpv4AddressNoZone(ipNeighborDetails.ipAddress)) + .ifPresent(ipNeighborDetails -> builder.setIp(arrayToIpv4AddressNoZone( + ipNeighborDetails.neighbor.ipAddress.un.getIp4().ip4Address)) .withKey(keyMapper().apply(ipNeighborDetails)) - .setLinkLayerAddress(toPhysAddress(ipNeighborDetails.macAddress))); + .setLinkLayerAddress(toPhysAddress(ipNeighborDetails.neighbor.macAddress.macaddress))); } } @@ -87,6 +89,7 @@ public class SubInterfaceIpv4NeighbourCustomizer extends IpNeighbourReader } private Function<IpNeighborDetails, NeighborKey> keyMapper() { - return ipNeighborDetails -> new NeighborKey(arrayToIpv4AddressNoZone(ipNeighborDetails.ipAddress)); + return ipNeighborDetails -> new NeighborKey( + arrayToIpv4AddressNoZone(ipNeighborDetails.neighbor.ipAddress.un.getIp4().ip4Address)); } } diff --git a/l3/impl/src/main/java/io/fd/hc2vpp/l3/read/ipv6/Ipv6NeighbourCustomizer.java b/l3/impl/src/main/java/io/fd/hc2vpp/l3/read/ipv6/Ipv6NeighbourCustomizer.java index 7d7578777..92f4962ee 100644 --- a/l3/impl/src/main/java/io/fd/hc2vpp/l3/read/ipv6/Ipv6NeighbourCustomizer.java +++ b/l3/impl/src/main/java/io/fd/hc2vpp/l3/read/ipv6/Ipv6NeighbourCustomizer.java @@ -31,6 +31,7 @@ import io.fd.honeycomb.translate.util.read.cache.DumpCacheManager; import io.fd.vpp.jvpp.core.dto.IpNeighborDetails; import io.fd.vpp.jvpp.core.dto.IpNeighborDetailsReplyDump; import io.fd.vpp.jvpp.core.future.FutureJVppCore; +import io.fd.vpp.jvpp.core.types.IpNeighborFlags; import java.util.List; import java.util.function.Function; import javax.annotation.Nonnull; @@ -69,12 +70,14 @@ public class Ipv6NeighbourCustomizer extends IpNeighbourReader if (dumpOpt.isPresent()) { dumpOpt.get().ipNeighborDetails .stream() - .filter(ipNeighborDetails -> ip.equals(arrayToIpv6AddressNoZone(ipNeighborDetails.ipAddress))) + .filter(ipNeighborDetails -> ip.equals(arrayToIpv6AddressNoZone( + ipNeighborDetails.neighbor.ipAddress.un.getIp6().ip6Address))) .findFirst() - .ifPresent(ipNeighborDetails -> builder.setIp(arrayToIpv6AddressNoZone(ipNeighborDetails.ipAddress)) + .ifPresent(ipNeighborDetails -> builder.setIp(arrayToIpv6AddressNoZone( + ipNeighborDetails.neighbor.ipAddress.un.getIp6().ip6Address)) .withKey(keyMapper().apply(ipNeighborDetails)) - .setLinkLayerAddress(toPhysAddress(ipNeighborDetails.macAddress)) - .setOrigin(ipNeighborDetails.isStatic == 0 + .setLinkLayerAddress(toPhysAddress(ipNeighborDetails.neighbor.macAddress.macaddress)) + .setOrigin(ipNeighborDetails.neighbor.flags != IpNeighborFlags.IP_API_NEIGHBOR_FLAG_STATIC ? Dynamic : Static)); } @@ -92,6 +95,7 @@ public class Ipv6NeighbourCustomizer extends IpNeighbourReader } private Function<IpNeighborDetails, NeighborKey> keyMapper() { - return ipNeighborDetails -> new NeighborKey(arrayToIpv6AddressNoZone(ipNeighborDetails.ipAddress)); + return ipNeighborDetails -> new NeighborKey( + arrayToIpv6AddressNoZone(ipNeighborDetails.neighbor.ipAddress.un.getIp6().ip6Address)); } }
\ No newline at end of file diff --git a/l3/impl/src/main/java/io/fd/hc2vpp/l3/read/ipv6/nd/NdProxyCustomizer.java b/l3/impl/src/main/java/io/fd/hc2vpp/l3/read/ipv6/nd/NdProxyCustomizer.java index acdb2098b..93e6275b9 100644 --- a/l3/impl/src/main/java/io/fd/hc2vpp/l3/read/ipv6/nd/NdProxyCustomizer.java +++ b/l3/impl/src/main/java/io/fd/hc2vpp/l3/read/ipv6/nd/NdProxyCustomizer.java @@ -88,7 +88,7 @@ public final class NdProxyCustomizer extends FutureJVppCustomizer return dump.get().ip6NdProxyDetails.stream() .filter(detail -> detail.swIfIndex == swIfIndex) - .map(detail -> new NdProxyKey(arrayToIpv6AddressNoZone(detail.address))) + .map(detail -> new NdProxyKey(arrayToIpv6AddressNoZone(detail.ip.ip6Address))) .collect(Collectors.toList()); } diff --git a/l3/impl/src/main/java/io/fd/hc2vpp/l3/read/ipv6/subinterface/SubInterfaceIpv6NeighbourCustomizer.java b/l3/impl/src/main/java/io/fd/hc2vpp/l3/read/ipv6/subinterface/SubInterfaceIpv6NeighbourCustomizer.java index 4a0286173..1227abc03 100644 --- a/l3/impl/src/main/java/io/fd/hc2vpp/l3/read/ipv6/subinterface/SubInterfaceIpv6NeighbourCustomizer.java +++ b/l3/impl/src/main/java/io/fd/hc2vpp/l3/read/ipv6/subinterface/SubInterfaceIpv6NeighbourCustomizer.java @@ -67,11 +67,13 @@ public class SubInterfaceIpv6NeighbourCustomizer extends IpNeighbourReader if (dumpOpt.isPresent()) { dumpOpt.get().ipNeighborDetails .stream() - .filter(ipNeighborDetails -> ip.equals(arrayToIpv6AddressNoZone(ipNeighborDetails.ipAddress))) + .filter(ipNeighborDetails -> ip.equals(arrayToIpv6AddressNoZone( + ipNeighborDetails.neighbor.ipAddress.un.getIp6().ip6Address))) .findFirst() - .ifPresent(ipNeighborDetails -> builder.setIp(arrayToIpv6AddressNoZone(ipNeighborDetails.ipAddress)) + .ifPresent(ipNeighborDetails -> builder.setIp(arrayToIpv6AddressNoZone( + ipNeighborDetails.neighbor.ipAddress.un.getIp6().ip6Address)) .withKey(keyMapper().apply(ipNeighborDetails)) - .setLinkLayerAddress(toPhysAddress(ipNeighborDetails.macAddress))); + .setLinkLayerAddress(toPhysAddress(ipNeighborDetails.neighbor.macAddress.macaddress))); } } @@ -87,6 +89,7 @@ public class SubInterfaceIpv6NeighbourCustomizer extends IpNeighbourReader } private Function<IpNeighborDetails, NeighborKey> keyMapper() { - return ipNeighborDetails -> new NeighborKey(arrayToIpv6AddressNoZone(ipNeighborDetails.ipAddress)); + return ipNeighborDetails -> new NeighborKey( + arrayToIpv6AddressNoZone(ipNeighborDetails.neighbor.ipAddress.un.getIp6().ip6Address)); } } diff --git a/l3/impl/src/main/java/io/fd/hc2vpp/l3/write/ipv4/Ipv4NeighbourCustomizer.java b/l3/impl/src/main/java/io/fd/hc2vpp/l3/write/ipv4/Ipv4NeighbourCustomizer.java index f8edcfb15..d5988fa9c 100644 --- a/l3/impl/src/main/java/io/fd/hc2vpp/l3/write/ipv4/Ipv4NeighbourCustomizer.java +++ b/l3/impl/src/main/java/io/fd/hc2vpp/l3/write/ipv4/Ipv4NeighbourCustomizer.java @@ -61,11 +61,11 @@ public class Ipv4NeighbourCustomizer extends FutureJVppCustomizer LOG.debug("Processing request for Neighbour {} write", id); addDelNeighbour(id, () -> { - IpNeighborAddDel request = preBindIpv4Request(true); + IpNeighborAddDel request = preBindRequest(true); - request.dstAddress = ipv4AddressNoZoneToArray(data.getIp()); - request.macAddress = parseMac(data.getLinkLayerAddress().getValue()); - request.swIfIndex = interfaceContext + request.neighbor.macAddress = parseMacAddress(data.getLinkLayerAddress().getValue()); + request.neighbor.ipAddress = ipv4AddressNoZoneToAddress(data.getIp()); + request.neighbor.swIfIndex = interfaceContext .getIndex(id.firstKeyOf(Interface.class).getName(), writeContext.getMappingContext()); return request; }, getFutureJVpp()); @@ -80,11 +80,11 @@ public class Ipv4NeighbourCustomizer extends FutureJVppCustomizer LOG.debug("Processing request for Neighbour {} delete", id); addDelNeighbour(id, () -> { - IpNeighborAddDel request = preBindIpv4Request(false); + IpNeighborAddDel request = preBindRequest(false); - request.dstAddress = ipv4AddressNoZoneToArray(data.getIp()); - request.macAddress = parseMac(data.getLinkLayerAddress().getValue()); - request.swIfIndex = interfaceContext + request.neighbor.macAddress = parseMacAddress(data.getLinkLayerAddress().getValue()); + request.neighbor.ipAddress = ipv4AddressNoZoneToAddress(data.getIp()); + request.neighbor.swIfIndex = interfaceContext .getIndex(id.firstKeyOf(Interface.class).getName(), writeContext.getMappingContext()); return request; }, getFutureJVpp()); 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 79d0e55e5..461de46c3 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 @@ -25,6 +25,7 @@ import io.fd.honeycomb.translate.write.WriteFailedException; 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.Ip4Address; import io.fd.vpp.jvpp.core.types.ProxyArp; import java.util.concurrent.Future; import javax.annotation.Nonnull; @@ -88,9 +89,11 @@ public class ProxyRangeCustomizer extends FutureJVppCustomizer final ProxyArpAddDel proxyArpAddDel = new ProxyArpAddDel(); proxyArpAddDel.isAdd = isAdd; proxyArpAddDel.proxy = new ProxyArp(); - proxyArpAddDel.proxy.lowAddress = Ipv4Translator.INSTANCE.ipv4AddressNoZoneToArray(lAddr); - proxyArpAddDel.proxy.hiAddress = Ipv4Translator.INSTANCE.ipv4AddressNoZoneToArray(hAddr); - proxyArpAddDel.proxy.vrfId = vrfId; + proxyArpAddDel.proxy.low = new Ip4Address(); + proxyArpAddDel.proxy.low.ip4Address = Ipv4Translator.INSTANCE.ipv4AddressNoZoneToArray(lAddr); + proxyArpAddDel.proxy.hi = new Ip4Address(); + proxyArpAddDel.proxy.hi.ip4Address = Ipv4Translator.INSTANCE.ipv4AddressNoZoneToArray(hAddr); + proxyArpAddDel.proxy.tableId = vrfId; return proxyArpAddDel; } } diff --git a/l3/impl/src/main/java/io/fd/hc2vpp/l3/write/ipv4/subinterface/SubInterfaceIpv4NeighbourCustomizer.java b/l3/impl/src/main/java/io/fd/hc2vpp/l3/write/ipv4/subinterface/SubInterfaceIpv4NeighbourCustomizer.java index 61685af9c..89d6dbf51 100644 --- a/l3/impl/src/main/java/io/fd/hc2vpp/l3/write/ipv4/subinterface/SubInterfaceIpv4NeighbourCustomizer.java +++ b/l3/impl/src/main/java/io/fd/hc2vpp/l3/write/ipv4/subinterface/SubInterfaceIpv4NeighbourCustomizer.java @@ -55,11 +55,11 @@ public class SubInterfaceIpv4NeighbourCustomizer extends FutureJVppCustomizer LOG.debug("Processing request for Neighbour {} write", id); addDelNeighbour(id, () -> { - IpNeighborAddDel request = preBindIpv4Request(true); + IpNeighborAddDel request = preBindRequest(true); - request.dstAddress = ipv4AddressNoZoneToArray(data.getIp()); - request.macAddress = parseMac(data.getLinkLayerAddress().getValue()); - request.swIfIndex = subInterfaceIndex(id, interfaceContext, writeContext.getMappingContext()); + request.neighbor.macAddress = parseMacAddress(data.getLinkLayerAddress().getValue()); + request.neighbor.ipAddress = ipv4AddressNoZoneToAddress(data.getIp()); + request.neighbor.swIfIndex = subInterfaceIndex(id, interfaceContext, writeContext.getMappingContext()); // we don't have support for sub-interface routing, so not setting vrf return request; @@ -75,11 +75,11 @@ public class SubInterfaceIpv4NeighbourCustomizer extends FutureJVppCustomizer LOG.debug("Processing request for Neighbour {} delete", id); addDelNeighbour(id, () -> { - IpNeighborAddDel request = preBindIpv4Request(false); + IpNeighborAddDel request = preBindRequest(false); - request.dstAddress = ipv4AddressNoZoneToArray(data.getIp()); - request.macAddress = parseMac(data.getLinkLayerAddress().getValue()); - request.swIfIndex = subInterfaceIndex(id, interfaceContext, writeContext.getMappingContext()); + request.neighbor.macAddress = parseMacAddress(data.getLinkLayerAddress().getValue()); + request.neighbor.ipAddress = ipv4AddressNoZoneToAddress(data.getIp()); + request.neighbor.swIfIndex = subInterfaceIndex(id, interfaceContext, writeContext.getMappingContext()); //TODO HONEYCOMB-182 if it is necessary for future use ,make adjustments to be able to set vrfid //request.vrfId diff --git a/l3/impl/src/main/java/io/fd/hc2vpp/l3/write/ipv6/Ipv6NeighbourCustomizer.java b/l3/impl/src/main/java/io/fd/hc2vpp/l3/write/ipv6/Ipv6NeighbourCustomizer.java index ed06ab08f..f7105088d 100644 --- a/l3/impl/src/main/java/io/fd/hc2vpp/l3/write/ipv6/Ipv6NeighbourCustomizer.java +++ b/l3/impl/src/main/java/io/fd/hc2vpp/l3/write/ipv6/Ipv6NeighbourCustomizer.java @@ -25,12 +25,14 @@ import io.fd.hc2vpp.common.translate.util.ByteDataTranslator; import io.fd.hc2vpp.common.translate.util.FutureJVppCustomizer; import io.fd.hc2vpp.common.translate.util.JvppReplyConsumer; import io.fd.hc2vpp.common.translate.util.NamingContext; +import io.fd.hc2vpp.l3.utils.ip.write.IpWriter; import io.fd.honeycomb.translate.MappingContext; import io.fd.honeycomb.translate.spi.write.ListWriterCustomizer; import io.fd.honeycomb.translate.write.WriteContext; import io.fd.honeycomb.translate.write.WriteFailedException; import io.fd.vpp.jvpp.core.dto.IpNeighborAddDel; import io.fd.vpp.jvpp.core.future.FutureJVppCore; +import io.fd.vpp.jvpp.core.types.IpNeighborFlags; import javax.annotation.Nonnull; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.Interface; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.ip.rev140616.interfaces._interface.ipv6.Neighbor; @@ -40,7 +42,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class Ipv6NeighbourCustomizer extends FutureJVppCustomizer - implements ListWriterCustomizer<Neighbor, NeighborKey>, ByteDataTranslator, AddressTranslator, + implements ListWriterCustomizer<Neighbor, NeighborKey>, ByteDataTranslator, AddressTranslator, IpWriter, JvppReplyConsumer { private static final Logger LOG = LoggerFactory.getLogger(Ipv6NeighbourCustomizer.class); @@ -59,7 +61,7 @@ public class Ipv6NeighbourCustomizer extends FutureJVppCustomizer checkNotNull(dataAfter, "Cannot write null neighbour"); checkArgument(id.firstKeyOf(Interface.class) != null, "No parent interface key found"); - LOG.debug("Processing request for Neigbour write"); + LOG.debug("Processing request for Neighbour write"); String interfaceName = id.firstKeyOf(Interface.class).getName(); MappingContext mappingContext = writeContext.getMappingContext(); @@ -79,7 +81,7 @@ public class Ipv6NeighbourCustomizer extends FutureJVppCustomizer checkNotNull(dataBefore, "Cannot delete null neighbour"); checkArgument(id.firstKeyOf(Interface.class) != null, "No parent interface key found"); - LOG.debug("Processing request for Neigbour delete"); + LOG.debug("Processing request for Neighbour delete"); String interfaceName = id.firstKeyOf(Interface.class).getName(); MappingContext mappingContext = writeContext.getMappingContext(); @@ -94,15 +96,13 @@ public class Ipv6NeighbourCustomizer extends FutureJVppCustomizer private void addDelNeighbourAndReply(InstanceIdentifier<Neighbor> id, boolean add, int parentInterfaceIndex, Neighbor data) throws WriteFailedException { - - IpNeighborAddDel request = new IpNeighborAddDel(); - - request.isAdd = booleanToByte(add); - request.isIpv6 = 1; - request.isStatic = 1; - request.dstAddress = ipv6AddressNoZoneToArray(data.getIp()); - request.macAddress = parseMac(data.getLinkLayerAddress().getValue()); - request.swIfIndex = parentInterfaceIndex; - getReplyForWrite(getFutureJVpp().ipNeighborAddDel(request).toCompletableFuture(), id); + addDelNeighbour(id, () -> { + IpNeighborAddDel request = preBindRequest(add); + request.neighbor.flags = IpNeighborFlags.IP_API_NEIGHBOR_FLAG_STATIC; + request.neighbor.macAddress = parseMacAddress(data.getLinkLayerAddress().getValue()); + request.neighbor.ipAddress = ipv6AddressToAddress(data.getIp()); + request.neighbor.swIfIndex = parentInterfaceIndex; + return request; + }, getFutureJVpp()); } } diff --git a/l3/impl/src/main/java/io/fd/hc2vpp/l3/write/ipv6/nd/NdProxyCustomizer.java b/l3/impl/src/main/java/io/fd/hc2vpp/l3/write/ipv6/nd/NdProxyCustomizer.java index ca6e2bf87..23556a468 100644 --- a/l3/impl/src/main/java/io/fd/hc2vpp/l3/write/ipv6/nd/NdProxyCustomizer.java +++ b/l3/impl/src/main/java/io/fd/hc2vpp/l3/write/ipv6/nd/NdProxyCustomizer.java @@ -27,6 +27,7 @@ import io.fd.honeycomb.translate.write.WriteContext; import io.fd.honeycomb.translate.write.WriteFailedException; import io.fd.vpp.jvpp.core.dto.Ip6NdProxyAddDel; import io.fd.vpp.jvpp.core.future.FutureJVppCore; +import io.fd.vpp.jvpp.core.types.Ip6Address; import javax.annotation.Nonnull; import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.nd.proxy.rev170315.interfaces._interface.ipv6.nd.proxies.NdProxy; import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.nd.proxy.rev170315.interfaces._interface.ipv6.nd.proxies.NdProxyKey; @@ -76,7 +77,8 @@ public final class NdProxyCustomizer extends FutureJVppCustomizer final Ip6NdProxyAddDel request = new Ip6NdProxyAddDel(); request.swIfIndex = swIfIndex; - request.address = addressBytes; + request.ip = new Ip6Address(); + request.ip.ip6Address = addressBytes; request.isDel = booleanToByte(!add); getReplyForWrite(getFutureJVpp().ip6NdProxyAddDel(request).toCompletableFuture(), id); diff --git a/l3/impl/src/main/java/io/fd/hc2vpp/l3/write/ipv6/subinterface/SubInterfaceIpv6NeighbourCustomizer.java b/l3/impl/src/main/java/io/fd/hc2vpp/l3/write/ipv6/subinterface/SubInterfaceIpv6NeighbourCustomizer.java index 3fc43f76b..00e499f92 100644 --- a/l3/impl/src/main/java/io/fd/hc2vpp/l3/write/ipv6/subinterface/SubInterfaceIpv6NeighbourCustomizer.java +++ b/l3/impl/src/main/java/io/fd/hc2vpp/l3/write/ipv6/subinterface/SubInterfaceIpv6NeighbourCustomizer.java @@ -55,11 +55,10 @@ public class SubInterfaceIpv6NeighbourCustomizer extends FutureJVppCustomizer LOG.debug("Processing request for Neighbour {} write", id); addDelNeighbour(id, () -> { - IpNeighborAddDel request = preBindIpv6Request(true); - - request.dstAddress = ipv6AddressNoZoneToArray(data.getIp()); - request.macAddress = parseMac(data.getLinkLayerAddress().getValue()); - request.swIfIndex = subInterfaceIndex(id, interfaceContext, writeContext.getMappingContext()); + IpNeighborAddDel request = preBindRequest(true); + request.neighbor.macAddress = parseMacAddress(data.getLinkLayerAddress().getValue()); + request.neighbor.ipAddress = ipv6AddressToAddress(data.getIp()); + request.neighbor.swIfIndex = subInterfaceIndex(id, interfaceContext, writeContext.getMappingContext()); // we don't have support for sub-interface routing, so not setting vrf return request; @@ -75,11 +74,10 @@ public class SubInterfaceIpv6NeighbourCustomizer extends FutureJVppCustomizer LOG.debug("Processing request for Neighbour {} delete", id); addDelNeighbour(id, () -> { - IpNeighborAddDel request = preBindIpv6Request(false); - - request.dstAddress = ipv6AddressNoZoneToArray(data.getIp()); - request.macAddress = parseMac(data.getLinkLayerAddress().getValue()); - request.swIfIndex = subInterfaceIndex(id, interfaceContext, writeContext.getMappingContext()); + IpNeighborAddDel request = preBindRequest(false); + request.neighbor.macAddress = parseMacAddress(data.getLinkLayerAddress().getValue()); + request.neighbor.ipAddress = ipv6AddressToAddress(data.getIp()); + request.neighbor.swIfIndex = subInterfaceIndex(id, interfaceContext, writeContext.getMappingContext()); //TODO HONEYCOMB-182 if it is necessary for future use ,make adjustments to be able to set vrfid //request.vrfId |