diff options
Diffstat (limited to 'l3/impl/src/main/java/io/fd/hc2vpp/l3/write/ipv6')
3 files changed, 24 insertions, 24 deletions
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 |