summaryrefslogtreecommitdiffstats
path: root/lisp/lisp2vpp/src/main/java
diff options
context:
space:
mode:
authorJan Srnicek <jsrnicek@cisco.com>2017-08-04 08:49:05 +0200
committerJan Srnicek <jsrnicek@cisco.com>2017-08-07 10:34:01 +0200
commit941edc8b15e5f3fed701b5585ce7ad421991b16d (patch)
tree55a73bd261f181cd890da517f25aeed519033af9 /lisp/lisp2vpp/src/main/java
parent1eac992e90839c99337a80db4ff6b880787a3056 (diff)
HC2VPP-162 - use composite key for locator pair
Removes need for custom mapping for locator pairs and their ids Change-Id: Idaa6ee5ec74d8bf57a72bea95c0c0d408e6e940e Signed-off-by: Jan Srnicek <jsrnicek@cisco.com>
Diffstat (limited to 'lisp/lisp2vpp/src/main/java')
-rw-r--r--lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/gpe/GpeModule.java6
-rw-r--r--lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/gpe/translate/ctx/GpeLocatorPair.java113
-rw-r--r--lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/gpe/translate/ctx/GpeLocatorPairMappingContext.java55
-rw-r--r--lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/gpe/translate/ctx/GpeLocatorPairMappingContextImpl.java145
-rw-r--r--lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/gpe/translate/read/GpeFeatureCustomizer.java8
-rw-r--r--lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/gpe/translate/read/GpeForwardEntryCustomizer.java58
-rw-r--r--lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/gpe/translate/read/GpeReaderFactory.java38
-rw-r--r--lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/gpe/translate/read/NativeForwardPathCustomizer.java26
-rw-r--r--lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/gpe/translate/read/NativeForwardPathsTableCustomizer.java20
-rw-r--r--lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/gpe/translate/service/GpeStateCheckServiceImpl.java8
-rw-r--r--lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/gpe/translate/write/GpeFeatureCustomizer.java2
-rw-r--r--lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/gpe/translate/write/GpeForwardEntryCustomizer.java55
-rw-r--r--lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/gpe/translate/write/GpeWriterFactory.java32
-rw-r--r--lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/gpe/translate/write/NativeForwardPathCustomizer.java4
-rw-r--r--lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/gpe/translate/write/NativeForwardPathsTableCustomizer.java4
-rwxr-xr-xlisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/util/EidTranslator.java20
16 files changed, 112 insertions, 482 deletions
diff --git a/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/gpe/GpeModule.java b/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/gpe/GpeModule.java
index efdc99834..0c3d667dd 100644
--- a/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/gpe/GpeModule.java
+++ b/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/gpe/GpeModule.java
@@ -21,8 +21,6 @@ import com.google.inject.Singleton;
import com.google.inject.multibindings.Multibinder;
import com.google.inject.name.Names;
import io.fd.hc2vpp.common.translate.util.NamingContext;
-import io.fd.hc2vpp.lisp.gpe.translate.ctx.GpeLocatorPairMappingContext;
-import io.fd.hc2vpp.lisp.gpe.translate.ctx.GpeLocatorPairMappingContextImpl;
import io.fd.hc2vpp.lisp.gpe.translate.read.GpeReaderFactory;
import io.fd.hc2vpp.lisp.gpe.translate.service.GpeStateCheckService;
import io.fd.hc2vpp.lisp.gpe.translate.service.GpeStateCheckServiceImpl;
@@ -33,16 +31,12 @@ import io.fd.honeycomb.translate.write.WriterFactory;
public class GpeModule extends AbstractModule {
public static final String GPE_ENTRY_MAPPING_CTX = "gpe-entry-mapping-ctx";
- public static final String GPE_TO_LOCATOR_PAIR_CTX = "gpe-to-locator-pair-ctx";
@Override
protected void configure() {
bind(NamingContext.class).annotatedWith(Names.named(GPE_ENTRY_MAPPING_CTX))
.toInstance(new NamingContext("gpe-entry-", GPE_ENTRY_MAPPING_CTX));
- bind(GpeLocatorPairMappingContext.class).annotatedWith(Names.named(GPE_TO_LOCATOR_PAIR_CTX))
- .toInstance(new GpeLocatorPairMappingContextImpl(GPE_TO_LOCATOR_PAIR_CTX));
-
bind(GpeStateCheckService.class).to(GpeStateCheckServiceImpl.class).in(Singleton.class);
Multibinder.newSetBinder(binder(), ReaderFactory.class).addBinding()
diff --git a/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/gpe/translate/ctx/GpeLocatorPair.java b/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/gpe/translate/ctx/GpeLocatorPair.java
deleted file mode 100644
index a5cf13191..000000000
--- a/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/gpe/translate/ctx/GpeLocatorPair.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- * Copyright (c) 2017 Cisco and/or its affiliates.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at:
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package io.fd.hc2vpp.lisp.gpe.translate.ctx;
-
-import io.fd.hc2vpp.common.translate.util.AddressTranslator;
-import io.fd.vpp.jvpp.core.dto.GpeFwdEntryPathDetails;
-import java.util.Arrays;
-import javax.annotation.Nonnull;
-import org.apache.commons.lang3.builder.EqualsBuilder;
-import org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.gpe.locator.pair.identification.context.rev170517.gpe.locator.pair.identification.context.attributes.gpe.locator.pair.identification.contexts.gpe.locator.pair.identification.mappings.mapping.locator.pair.mapping.Pair;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170518.gpe.entry.table.grouping.gpe.entry.table.gpe.entry.LocatorPairs;
-
-public final class GpeLocatorPair implements AddressTranslator {
-
- private final IpAddress localAddress;
- private final IpAddress remoteAddress;
-
- private GpeLocatorPair(@Nonnull final IpAddress localAddress, @Nonnull final IpAddress remoteAddress) {
- this.localAddress = localAddress;
- this.remoteAddress = remoteAddress;
- }
-
- public IpAddress getLocalAddress() {
- return localAddress;
- }
-
- public IpAddress getRemoteAddress() {
- return remoteAddress;
- }
-
- public boolean isSame(@Nonnull final Pair pair) {
- return new EqualsBuilder()
- .append(true, Arrays.equals(this.localAddress.getValue(), pair.getLocalAddress().getValue()))
- .append(true, Arrays.equals(this.remoteAddress.getValue(), pair.getRemoteAddress().getValue()))
- .isEquals();
- }
-
- public static GpeLocatorPair fromDumpDetail(final GpeFwdEntryPathDetails entry) {
- return new GpeLocatorPair.GpeLocatorPairBuilder()
- .setLocalAddress(
- INSTANCE.arrayToIpAddress(!INSTANCE.byteToBoolean(entry.lclLoc.isIp4),
- entry.lclLoc.addr))
- .setRemoteAddress(
- INSTANCE.arrayToIpAddress(!INSTANCE.byteToBoolean(entry.rmtLoc.isIp4),
- entry.rmtLoc.addr))
- .createGpeLocatorPairIdentifier();
- }
-
- public static GpeLocatorPair fromLocatorPair(final LocatorPairs locatorPair) {
- return new GpeLocatorPair.GpeLocatorPairBuilder()
- .setLocalAddress(locatorPair.getLocatorPair().getLocalLocator())
- .setRemoteAddress(locatorPair.getLocatorPair().getRemoteLocator())
- .createGpeLocatorPairIdentifier();
- }
-
- public static final class GpeLocatorPairBuilder {
- private IpAddress localAddress;
- private IpAddress remoteAddress;
-
- public GpeLocatorPairBuilder setLocalAddress(@Nonnull final IpAddress localAddress) {
- this.localAddress = localAddress;
- return this;
- }
-
- public GpeLocatorPairBuilder setRemoteAddress(@Nonnull final IpAddress remoteAddress) {
- this.remoteAddress = remoteAddress;
- return this;
- }
-
- public GpeLocatorPair createGpeLocatorPairIdentifier() {
- return new GpeLocatorPair(localAddress, remoteAddress);
- }
- }
-
- @Override
- public boolean equals(final Object o) {
- if (this == o) {
- return true;
- }
- if (o == null || getClass() != o.getClass()) {
- return false;
- }
-
- final GpeLocatorPair that = (GpeLocatorPair) o;
-
- if (!localAddress.equals(that.localAddress)) {
- return false;
- }
- return remoteAddress.equals(that.remoteAddress);
- }
-
- @Override
- public int hashCode() {
- int result = localAddress.hashCode();
- result = 31 * result + remoteAddress.hashCode();
- return result;
- }
-}
diff --git a/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/gpe/translate/ctx/GpeLocatorPairMappingContext.java b/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/gpe/translate/ctx/GpeLocatorPairMappingContext.java
deleted file mode 100644
index b2226a1b6..000000000
--- a/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/gpe/translate/ctx/GpeLocatorPairMappingContext.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright (c) 2017 Cisco and/or its affiliates.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at:
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package io.fd.hc2vpp.lisp.gpe.translate.ctx;
-
-import io.fd.honeycomb.translate.MappingContext;
-import javax.annotation.Nonnull;
-import org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.gpe.locator.pair.identification.context.rev170517.gpe.locator.pair.identification.context.attributes.gpe.locator.pair.identification.contexts.gpe.locator.pair.identification.mappings.mapping.LocatorPairMapping;
-
-/**
- * Context mapping of gpe entries to locator pairs
- */
-public interface GpeLocatorPairMappingContext {
-
- /**
- * Adds mapping for entry and specified locator
- */
- void addMapping(@Nonnull String entryId,
- @Nonnull String locatorId,
- @Nonnull GpeLocatorPair pair,
- @Nonnull MappingContext mappingContext);
-
- /**
- * Remote all mappings for entry
- */
- void removeMapping(@Nonnull String entryId,
- @Nonnull MappingContext mappingContext);
-
- /**
- * Returns mapping for specified entry and locator
- */
- LocatorPairMapping getMapping(@Nonnull String entryId,
- @Nonnull GpeLocatorPair pair,
- @Nonnull MappingContext mappingContext);
-
- /**
- * Returns mapping for specified entry and locator
- */
- LocatorPairMapping getMapping(@Nonnull String entryId,
- @Nonnull String locatorId,
- @Nonnull MappingContext mappingContext);
-}
diff --git a/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/gpe/translate/ctx/GpeLocatorPairMappingContextImpl.java b/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/gpe/translate/ctx/GpeLocatorPairMappingContextImpl.java
deleted file mode 100644
index 766478fd5..000000000
--- a/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/gpe/translate/ctx/GpeLocatorPairMappingContextImpl.java
+++ /dev/null
@@ -1,145 +0,0 @@
-/*
- * Copyright (c) 2017 Cisco and/or its affiliates.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at:
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package io.fd.hc2vpp.lisp.gpe.translate.ctx;
-
-import static java.lang.String.format;
-
-import io.fd.honeycomb.translate.MappingContext;
-import io.fd.honeycomb.translate.util.RWUtils;
-import java.util.Collections;
-import javax.annotation.Nonnull;
-import org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.gpe.locator.pair.identification.context.rev170517.GpeLocatorPairIdentificationCtxAugmentation;
-import org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.gpe.locator.pair.identification.context.rev170517.gpe.locator.pair.identification.context.attributes.GpeLocatorPairIdentificationContexts;
-import org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.gpe.locator.pair.identification.context.rev170517.gpe.locator.pair.identification.context.attributes.gpe.locator.pair.identification.contexts.GpeLocatorPairIdentification;
-import org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.gpe.locator.pair.identification.context.rev170517.gpe.locator.pair.identification.context.attributes.gpe.locator.pair.identification.contexts.GpeLocatorPairIdentificationKey;
-import org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.gpe.locator.pair.identification.context.rev170517.gpe.locator.pair.identification.context.attributes.gpe.locator.pair.identification.contexts.gpe.locator.pair.identification.Mappings;
-import org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.gpe.locator.pair.identification.context.rev170517.gpe.locator.pair.identification.context.attributes.gpe.locator.pair.identification.contexts.gpe.locator.pair.identification.mappings.Mapping;
-import org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.gpe.locator.pair.identification.context.rev170517.gpe.locator.pair.identification.context.attributes.gpe.locator.pair.identification.contexts.gpe.locator.pair.identification.mappings.MappingBuilder;
-import org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.gpe.locator.pair.identification.context.rev170517.gpe.locator.pair.identification.context.attributes.gpe.locator.pair.identification.contexts.gpe.locator.pair.identification.mappings.MappingKey;
-import org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.gpe.locator.pair.identification.context.rev170517.gpe.locator.pair.identification.context.attributes.gpe.locator.pair.identification.contexts.gpe.locator.pair.identification.mappings.mapping.LocatorPairMapping;
-import org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.gpe.locator.pair.identification.context.rev170517.gpe.locator.pair.identification.context.attributes.gpe.locator.pair.identification.contexts.gpe.locator.pair.identification.mappings.mapping.LocatorPairMappingBuilder;
-import org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.gpe.locator.pair.identification.context.rev170517.gpe.locator.pair.identification.context.attributes.gpe.locator.pair.identification.contexts.gpe.locator.pair.identification.mappings.mapping.locator.pair.mapping.PairBuilder;
-import org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.naming.context.rev160513.Contexts;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import org.opendaylight.yangtools.yang.binding.KeyedInstanceIdentifier;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class GpeLocatorPairMappingContextImpl implements GpeLocatorPairMappingContext {
-
- private static final Logger LOG = LoggerFactory.getLogger(GpeLocatorPairMappingContextImpl.class);
-
- private final KeyedInstanceIdentifier<GpeLocatorPairIdentification, GpeLocatorPairIdentificationKey>
- namingContextIid;
-
- public GpeLocatorPairMappingContextImpl(@Nonnull final String instanceName) {
- namingContextIid = InstanceIdentifier.create(Contexts.class)
- .augmentation(GpeLocatorPairIdentificationCtxAugmentation.class)
- .child(GpeLocatorPairIdentificationContexts.class)
- .child(GpeLocatorPairIdentification.class, new GpeLocatorPairIdentificationKey(instanceName));
- }
-
-
- @Override
- public void addMapping(@Nonnull final String entryId,
- @Nonnull final String locatorId,
- @Nonnull final GpeLocatorPair pair,
- @Nonnull final MappingContext mappingContext) {
- LOG.debug("Adding mapping for Gpe entry to locator id[entry-id={},locator-pair-id={}]", entryId, locatorId);
- mappingContext.merge(getMappingId(entryId), getMappingData(entryId, locatorId, pair));
- LOG.debug("Mapping for Gpe entry to locator id[entry-id={},locator-pair-id={}] successfully added", entryId,
- locatorId);
- }
-
- @Override
- public void removeMapping(@Nonnull final String entryId,
- @Nonnull final MappingContext mappingContext) {
- LOG.debug("Removing all mappings for Gpe entry[id={}]", entryId);
- KeyedInstanceIdentifier<Mapping, MappingKey> mappingId = getMappingId(entryId);
- // if no mapping present, no need to invoke delete(it would throw error because of non existing parent data)
- if (mappingContext.read(mappingId).isPresent()) {
- mappingContext.delete(mappingId);
- }
- LOG.debug("All mappings for Gpe entry[id={}] removed", entryId);
- }
-
- @Override
- public LocatorPairMapping getMapping(@Nonnull final String entryId,
- @Nonnull final GpeLocatorPair pair,
- @Nonnull final MappingContext mappingContext) {
-
- if (!contains(entryId, pair, mappingContext)) {
- final String artificialLocatorId = artificialLocatorPairId(entryId, pair);
- addMapping(entryId, artificialLocatorId, pair, mappingContext);
- return getMapping(entryId, artificialLocatorId, mappingContext);
- }
-
- return mappingContext.read(getMappingId(entryId))
- .or(new MappingBuilder().setLocatorPairMapping(Collections.emptyList()).build())
- .getLocatorPairMapping()
- .stream()
- .filter(mapping -> pair.isSame(mapping.getPair()))
- .collect(RWUtils.singleItemCollector());
- }
-
- private boolean contains(final String entryId,
- final GpeLocatorPair pair,
- final MappingContext mappingContext) {
- return mappingContext.read(getMappingId(entryId))
- .or(new MappingBuilder().setLocatorPairMapping(Collections.emptyList()).build())
- .getLocatorPairMapping()
- .stream()
- .anyMatch(mapping -> pair.isSame(mapping.getPair()));
- }
-
- @Override
- public LocatorPairMapping getMapping(@Nonnull final String entryId,
- @Nonnull final String locatorId,
- @Nonnull final MappingContext mappingContext) {
- return mappingContext.read(getMappingId(entryId))
- .or(new MappingBuilder().setLocatorPairMapping(Collections.emptyList()).build())
- .getLocatorPairMapping()
- .stream()
- .filter(mapping -> mapping.getId().equals(locatorId))
- .findAny().orElseThrow(() -> new IllegalArgumentException(
- format("No mapping for entry %s|locator %s", entryId, locatorId)));
- }
-
- private String artificialLocatorPairId(final String entryId, final GpeLocatorPair pair) {
- return format("%s_%s_%s", entryId, pair.getLocalAddress(), pair.getRemoteAddress());
- }
-
- private Mapping getMappingData(final String entryId,
- final String locatorId,
- final GpeLocatorPair identifier) {
- return new MappingBuilder()
- .setId(entryId)
- .setLocatorPairMapping(Collections.singletonList(new LocatorPairMappingBuilder()
- .setId(locatorId)
- .setPair(new PairBuilder()
- .setLocalAddress(identifier.getLocalAddress())
- .setRemoteAddress(identifier.getRemoteAddress())
- .build())
- .build())).build();
- }
-
- private KeyedInstanceIdentifier<Mapping, MappingKey> getMappingId(final String id) {
- return namingContextIid.child(Mappings.class)
- .child(Mapping.class, new MappingKey(id));
- }
-}
-
diff --git a/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/gpe/translate/read/GpeFeatureCustomizer.java b/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/gpe/translate/read/GpeFeatureCustomizer.java
index d274d90dc..bfa6dc71a 100644
--- a/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/gpe/translate/read/GpeFeatureCustomizer.java
+++ b/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/gpe/translate/read/GpeFeatureCustomizer.java
@@ -28,10 +28,10 @@ import io.fd.vpp.jvpp.core.dto.ShowLispStatus;
import io.fd.vpp.jvpp.core.dto.ShowLispStatusReply;
import io.fd.vpp.jvpp.core.future.FutureJVppCore;
import javax.annotation.Nonnull;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170518.Gpe;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170518.GpeStateBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170518.gpe.feature.data.grouping.GpeFeatureData;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170518.gpe.feature.data.grouping.GpeFeatureDataBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170801.Gpe;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170801.GpeStateBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170801.gpe.feature.data.grouping.GpeFeatureData;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170801.gpe.feature.data.grouping.GpeFeatureDataBuilder;
import org.opendaylight.yangtools.concepts.Builder;
import org.opendaylight.yangtools.yang.binding.DataObject;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
diff --git a/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/gpe/translate/read/GpeForwardEntryCustomizer.java b/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/gpe/translate/read/GpeForwardEntryCustomizer.java
index e6e4e4491..35e5566f2 100644
--- a/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/gpe/translate/read/GpeForwardEntryCustomizer.java
+++ b/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/gpe/translate/read/GpeForwardEntryCustomizer.java
@@ -16,7 +16,6 @@
package io.fd.hc2vpp.lisp.gpe.translate.read;
-import static io.fd.hc2vpp.lisp.gpe.translate.ctx.GpeLocatorPair.fromDumpDetail;
import static io.fd.honeycomb.translate.util.read.cache.EntityDumpExecutor.NO_PARAMS;
import static java.lang.String.format;
@@ -24,8 +23,6 @@ import com.google.common.base.Optional;
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.lisp.gpe.translate.ctx.GpeLocatorPair;
-import io.fd.hc2vpp.lisp.gpe.translate.ctx.GpeLocatorPairMappingContext;
import io.fd.hc2vpp.lisp.gpe.translate.service.GpeStateCheckService;
import io.fd.hc2vpp.lisp.translate.read.dump.executor.params.MappingsDumpParams;
import io.fd.hc2vpp.lisp.translate.util.EidTranslator;
@@ -44,23 +41,22 @@ import io.fd.vpp.jvpp.core.dto.GpeFwdEntryVnisGet;
import io.fd.vpp.jvpp.core.dto.GpeFwdEntryVnisGetReply;
import io.fd.vpp.jvpp.core.future.FutureJVppCore;
import io.fd.vpp.jvpp.core.types.GpeFwdEntry;
+import io.fd.vpp.jvpp.core.types.GpeLocator;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import javax.annotation.Nonnull;
-import org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.gpe.locator.pair.identification.context.rev170517.gpe.locator.pair.identification.context.attributes.gpe.locator.pair.identification.contexts.gpe.locator.pair.identification.mappings.mapping.LocatorPairMapping;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170518.Gpe;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170518.gpe.entry.table.grouping.GpeEntryTable;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170518.gpe.entry.table.grouping.GpeEntryTableBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170518.gpe.entry.table.grouping.gpe.entry.table.GpeEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170518.gpe.entry.table.grouping.gpe.entry.table.GpeEntryBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170518.gpe.entry.table.grouping.gpe.entry.table.GpeEntryKey;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170518.gpe.entry.table.grouping.gpe.entry.table.gpe.entry.LocatorPairs;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170518.gpe.entry.table.grouping.gpe.entry.table.gpe.entry.LocatorPairsBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170518.gpe.feature.data.grouping.GpeFeatureData;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170518.locator.pair.LocatorPairBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170801.Gpe;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170801.gpe.entry.table.grouping.GpeEntryTable;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170801.gpe.entry.table.grouping.GpeEntryTableBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170801.gpe.entry.table.grouping.gpe.entry.table.GpeEntry;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170801.gpe.entry.table.grouping.gpe.entry.table.GpeEntryBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170801.gpe.entry.table.grouping.gpe.entry.table.GpeEntryKey;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170801.gpe.feature.data.grouping.GpeFeatureData;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170801.locator.pairs.grouping.LocatorPair;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170801.locator.pairs.grouping.LocatorPairBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev170315.MapReplyAction;
import org.opendaylight.yangtools.concepts.Builder;
import org.opendaylight.yangtools.yang.binding.DataObject;
@@ -74,17 +70,14 @@ public class GpeForwardEntryCustomizer extends FutureJVppCustomizer
private final DumpCacheManager<GpeFwdEntryPathDetailsReplyDump, Integer> entryDumpCacheManager;
private final DumpCacheManager<GpeFwdEntryVnisGetReply, Void> activeVnisDumpManager;
private final NamingContext gpeEntryMappingContext;
- private final GpeLocatorPairMappingContext gpeLocatorsMappingContext;
private final GpeStateCheckService gpeStateCheckService;
public GpeForwardEntryCustomizer(@Nonnull final FutureJVppCore futureJVppCore,
@Nonnull final GpeStateCheckService gpeStateCheckService,
- @Nonnull final NamingContext gpeEntryMappingContext,
- @Nonnull final GpeLocatorPairMappingContext gpeLocatorsMappingContext) {
+ @Nonnull final NamingContext gpeEntryMappingContext) {
super(futureJVppCore);
this.gpeStateCheckService = gpeStateCheckService;
this.gpeEntryMappingContext = gpeEntryMappingContext;
- this.gpeLocatorsMappingContext = gpeLocatorsMappingContext;
this.entryDumpManager = new DumpCacheManager.DumpCacheManagerBuilder<GpeFwdEntriesGetReply, Integer>()
.acceptOnly(GpeFwdEntriesGetReply.class)
.withExecutor((identifier, vni) -> {
@@ -185,17 +178,13 @@ public class GpeForwardEntryCustomizer extends FutureJVppCustomizer
// if any locators exist,it is a positive mapping
if (locatorsDump.isPresent() && locatorsDump.get().gpeFwdEntryPathDetails != null &&
!locatorsDump.get().gpeFwdEntryPathDetails.isEmpty()) {
- final List<LocatorPairs> pairs =
+ final List<LocatorPair> pairs =
java.util.Optional.ofNullable(locatorsDump.get().gpeFwdEntryPathDetails)
.orElse(Collections.emptyList())
.stream()
- .map(entry -> {
- final GpeLocatorPair gpePair = fromDumpDetail(entry);
- final LocatorPairMapping mapping = gpeLocatorsMappingContext
- .getMapping(entryId, gpePair, ctx.getMappingContext());
- return buildLocatorPair(entry, gpePair, mapping);
- }).collect(Collectors.toList());
- builder.setLocatorPairs(pairs);
+ .map(entry -> buildLocatorPair(entry))
+ .collect(Collectors.toList());
+ builder.setLocatorPair(pairs);
} else {
// negative otherwise
builder.setAction(MapReplyAction.forValue(gpeFwdEntry.action));
@@ -245,16 +234,13 @@ public class GpeForwardEntryCustomizer extends FutureJVppCustomizer
return dump;
}
- private LocatorPairs buildLocatorPair(final GpeFwdEntryPathDetails entry, final GpeLocatorPair gpePair,
- final LocatorPairMapping mapping) {
- return new LocatorPairsBuilder()
- .setId(mapping.getId())
- .setLocatorPair(new LocatorPairBuilder()
- .setLocalLocator(gpePair.getLocalAddress())
- .setRemoteLocator(gpePair.getRemoteAddress())
- .setWeight((short) entry.lclLoc.weight)
- .build())
- .build();
+ private LocatorPair buildLocatorPair(final GpeFwdEntryPathDetails entry) {
+ final GpeLocator lclLoc = entry.lclLoc;
+ final GpeLocator rmtLoc = entry.rmtLoc;
+ return new LocatorPairBuilder()
+ .setLocalLocator(arrayToIpAddress(!byteToBoolean(lclLoc.isIp4), lclLoc.addr))
+ .setRemoteLocator(arrayToIpAddress(!byteToBoolean(rmtLoc.isIp4), rmtLoc.addr))
+ .setWeight((short) lclLoc.weight).build();
}
private Stream<Integer> activeVnis(final InstanceIdentifier<GpeEntry> id,
diff --git a/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/gpe/translate/read/GpeReaderFactory.java b/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/gpe/translate/read/GpeReaderFactory.java
index 2c5da177e..9532dd960 100644
--- a/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/gpe/translate/read/GpeReaderFactory.java
+++ b/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/gpe/translate/read/GpeReaderFactory.java
@@ -21,7 +21,6 @@ import com.google.inject.Inject;
import com.google.inject.name.Named;
import io.fd.hc2vpp.common.translate.util.NamingContext;
import io.fd.hc2vpp.lisp.gpe.GpeModule;
-import io.fd.hc2vpp.lisp.gpe.translate.ctx.GpeLocatorPairMappingContext;
import io.fd.hc2vpp.lisp.gpe.translate.service.GpeStateCheckService;
import io.fd.honeycomb.translate.impl.read.GenericInitListReader;
import io.fd.honeycomb.translate.impl.read.GenericInitReader;
@@ -29,20 +28,19 @@ import io.fd.honeycomb.translate.read.ReaderFactory;
import io.fd.honeycomb.translate.read.registry.ModifiableReaderRegistryBuilder;
import io.fd.vpp.jvpp.core.future.FutureJVppCore;
import javax.annotation.Nonnull;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170518.GpeState;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170518.GpeStateBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170518.NativeForwardPathsTablesState;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170518.NativeForwardPathsTablesStateBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170518._native.forward.paths.tables.state.NativeForwardPathsTable;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170518._native.forward.paths.tables.state._native.forward.paths.table.NativeForwardPath;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170518.gpe.entry.table.grouping.GpeEntryTable;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170518.gpe.entry.table.grouping.GpeEntryTableBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170518.gpe.entry.table.grouping.gpe.entry.table.GpeEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170518.gpe.entry.table.grouping.gpe.entry.table.gpe.entry.LocalEid;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170518.gpe.entry.table.grouping.gpe.entry.table.gpe.entry.LocatorPairs;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170518.gpe.entry.table.grouping.gpe.entry.table.gpe.entry.RemoteEid;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170518.gpe.feature.data.grouping.GpeFeatureData;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170518.locator.pair.LocatorPair;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170801.GpeState;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170801.GpeStateBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170801.NativeForwardPathsTablesState;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170801.NativeForwardPathsTablesStateBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170801._native.forward.paths.tables.state.NativeForwardPathsTable;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170801._native.forward.paths.tables.state._native.forward.paths.table.NativeForwardPath;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170801.gpe.entry.table.grouping.GpeEntryTable;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170801.gpe.entry.table.grouping.GpeEntryTableBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170801.gpe.entry.table.grouping.gpe.entry.table.GpeEntry;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170801.gpe.entry.table.grouping.gpe.entry.table.gpe.entry.LocalEid;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170801.gpe.entry.table.grouping.gpe.entry.table.gpe.entry.RemoteEid;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170801.gpe.feature.data.grouping.GpeFeatureData;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170801.locator.pairs.grouping.LocatorPair;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
public class GpeReaderFactory implements ReaderFactory {
@@ -67,10 +65,6 @@ public class GpeReaderFactory implements ReaderFactory {
private NamingContext gpeEntryMappingContext;
@Inject
- @Named(GpeModule.GPE_TO_LOCATOR_PAIR_CTX)
- private GpeLocatorPairMappingContext gpeLocatorPairMappingContext;
-
- @Inject
@Named("interface-context")
private NamingContext interfaceContext;
@@ -84,11 +78,9 @@ public class GpeReaderFactory implements ReaderFactory {
registry.subtreeAdd(ImmutableSet.of(
entrySubtreeId.child(LocalEid.class),
entrySubtreeId.child(RemoteEid.class),
- entrySubtreeId.child(LocatorPairs.class),
- entrySubtreeId.child(LocatorPairs.class).child(LocatorPair.class)),
+ entrySubtreeId.child(LocatorPair.class)),
new GenericInitListReader<>(GPE_ENTRY_ID,
- new GpeForwardEntryCustomizer(api, gpeStateCheckService, gpeEntryMappingContext,
- gpeLocatorPairMappingContext)));
+ new GpeForwardEntryCustomizer(api, gpeStateCheckService, gpeEntryMappingContext)));
final InstanceIdentifier<NativeForwardPathsTablesState> tablesId =
InstanceIdentifier.create(NativeForwardPathsTablesState.class);
diff --git a/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/gpe/translate/read/NativeForwardPathCustomizer.java b/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/gpe/translate/read/NativeForwardPathCustomizer.java
index b8a59a181..978d78648 100644
--- a/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/gpe/translate/read/NativeForwardPathCustomizer.java
+++ b/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/gpe/translate/read/NativeForwardPathCustomizer.java
@@ -39,13 +39,13 @@ import java.util.stream.Collectors;
import java.util.stream.Stream;
import javax.annotation.Nonnull;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170518.NativeForwardPathsTables;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170518._native.forward.paths.tables.NativeForwardPathsTableKey;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170518._native.forward.paths.tables.state.NativeForwardPathsTable;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170518._native.forward.paths.tables.state.NativeForwardPathsTableBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170518._native.forward.paths.tables.state._native.forward.paths.table.NativeForwardPath;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170518._native.forward.paths.tables.state._native.forward.paths.table.NativeForwardPathBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170518._native.forward.paths.tables.state._native.forward.paths.table.NativeForwardPathKey;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170801.NativeForwardPathsTables;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170801._native.forward.paths.tables.NativeForwardPathsTableKey;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170801._native.forward.paths.tables.state.NativeForwardPathsTable;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170801._native.forward.paths.tables.state.NativeForwardPathsTableBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170801._native.forward.paths.tables.state._native.forward.paths.table.NativeForwardPath;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170801._native.forward.paths.tables.state._native.forward.paths.table.NativeForwardPathBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170801._native.forward.paths.tables.state._native.forward.paths.table.NativeForwardPathKey;
import org.opendaylight.yangtools.concepts.Builder;
import org.opendaylight.yangtools.yang.binding.DataObject;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
@@ -80,18 +80,18 @@ public class NativeForwardPathCustomizer extends FutureJVppCustomizer
@Nonnull final NativeForwardPath readValue,
@Nonnull final ReadContext ctx) {
final Long tableId = id.firstKeyOf(NativeForwardPathsTable.class).getTableId();
- final KeyedInstanceIdentifier<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170518._native.forward.paths.tables._native.forward.paths.table.NativeForwardPath, org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170518._native.forward.paths.tables._native.forward.paths.table.NativeForwardPathKey>
+ final KeyedInstanceIdentifier<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170801._native.forward.paths.tables._native.forward.paths.table.NativeForwardPath, org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170801._native.forward.paths.tables._native.forward.paths.table.NativeForwardPathKey>
cfgId = InstanceIdentifier.create(NativeForwardPathsTables.class)
- .child(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170518._native.forward.paths.tables.NativeForwardPathsTable.class,
+ .child(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170801._native.forward.paths.tables.NativeForwardPathsTable.class,
new NativeForwardPathsTableKey(
tableId))
- .child(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170518._native.forward.paths.tables._native.forward.paths.table.NativeForwardPath.class,
- new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170518._native.forward.paths.tables._native.forward.paths.table.NativeForwardPathKey(
+ .child(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170801._native.forward.paths.tables._native.forward.paths.table.NativeForwardPath.class,
+ new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170801._native.forward.paths.tables._native.forward.paths.table.NativeForwardPathKey(
readValue.getNextHopAddress()));
- final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170518._native.forward.paths.tables._native.forward.paths.table.NativeForwardPath
+ final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170801._native.forward.paths.tables._native.forward.paths.table.NativeForwardPath
cfgValue =
- new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170518._native.forward.paths.tables._native.forward.paths.table.NativeForwardPathBuilder()
+ new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170801._native.forward.paths.tables._native.forward.paths.table.NativeForwardPathBuilder()
.setNextHopAddress(readValue.getNextHopAddress())
.setNextHopInterface(readValue.getNextHopInterface())
.build();
diff --git a/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/gpe/translate/read/NativeForwardPathsTableCustomizer.java b/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/gpe/translate/read/NativeForwardPathsTableCustomizer.java
index 055f38ae8..d787592dd 100644
--- a/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/gpe/translate/read/NativeForwardPathsTableCustomizer.java
+++ b/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/gpe/translate/read/NativeForwardPathsTableCustomizer.java
@@ -37,11 +37,11 @@ import java.util.OptionalLong;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import javax.annotation.Nonnull;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170518.NativeForwardPathsTables;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170518.NativeForwardPathsTablesStateBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170518._native.forward.paths.tables.state.NativeForwardPathsTable;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170518._native.forward.paths.tables.state.NativeForwardPathsTableBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170518._native.forward.paths.tables.state.NativeForwardPathsTableKey;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170801.NativeForwardPathsTables;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170801.NativeForwardPathsTablesStateBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170801._native.forward.paths.tables.state.NativeForwardPathsTable;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170801._native.forward.paths.tables.state.NativeForwardPathsTableBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170801._native.forward.paths.tables.state.NativeForwardPathsTableKey;
import org.opendaylight.yangtools.concepts.Builder;
import org.opendaylight.yangtools.yang.binding.DataObject;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
@@ -82,16 +82,16 @@ public class NativeForwardPathsTableCustomizer extends FutureJVppCustomizer impl
public Initialized<? extends DataObject> init(@Nonnull final InstanceIdentifier<NativeForwardPathsTable> id,
@Nonnull final NativeForwardPathsTable readValue,
@Nonnull final ReadContext ctx) {
- final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170518._native.forward.paths.tables.NativeForwardPathsTable
+ final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170801._native.forward.paths.tables.NativeForwardPathsTable
cfgValue =
- new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170518._native.forward.paths.tables.NativeForwardPathsTableBuilder()
+ new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170801._native.forward.paths.tables.NativeForwardPathsTableBuilder()
.setTableId(readValue.getTableId())
.build();
- final KeyedInstanceIdentifier<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170518._native.forward.paths.tables.NativeForwardPathsTable, org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170518._native.forward.paths.tables.NativeForwardPathsTableKey>
+ final KeyedInstanceIdentifier<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170801._native.forward.paths.tables.NativeForwardPathsTable, org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170801._native.forward.paths.tables.NativeForwardPathsTableKey>
cfgKey = InstanceIdentifier.create(NativeForwardPathsTables.class)
- .child(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170518._native.forward.paths.tables.NativeForwardPathsTable.class,
- new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170518._native.forward.paths.tables.NativeForwardPathsTableKey(
+ .child(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170801._native.forward.paths.tables.NativeForwardPathsTable.class,
+ new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170801._native.forward.paths.tables.NativeForwardPathsTableKey(
cfgValue.getKey()));
return Initialized.create(cfgKey, cfgValue);
diff --git a/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/gpe/translate/service/GpeStateCheckServiceImpl.java b/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/gpe/translate/service/GpeStateCheckServiceImpl.java
index b09b7ad98..8d45f2387 100644
--- a/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/gpe/translate/service/GpeStateCheckServiceImpl.java
+++ b/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/gpe/translate/service/GpeStateCheckServiceImpl.java
@@ -31,10 +31,10 @@ import io.fd.vpp.jvpp.core.dto.ShowLispStatus;
import io.fd.vpp.jvpp.core.dto.ShowLispStatusReply;
import io.fd.vpp.jvpp.core.future.FutureJVppCore;
import javax.annotation.Nonnull;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170518.Gpe;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170518.GpeState;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170518.gpe.feature.data.grouping.GpeFeatureData;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170518.gpe.feature.data.grouping.GpeFeatureDataBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170801.Gpe;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170801.GpeState;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170801.gpe.feature.data.grouping.GpeFeatureData;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170801.gpe.feature.data.grouping.GpeFeatureDataBuilder;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
public final class GpeStateCheckServiceImpl implements GpeStateCheckService, JvppReplyConsumer, ByteDataTranslator {
diff --git a/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/gpe/translate/write/GpeFeatureCustomizer.java b/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/gpe/translate/write/GpeFeatureCustomizer.java
index d384af094..542928d42 100644
--- a/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/gpe/translate/write/GpeFeatureCustomizer.java
+++ b/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/gpe/translate/write/GpeFeatureCustomizer.java
@@ -27,7 +27,7 @@ import io.fd.vpp.jvpp.core.dto.GpeEnableDisableReply;
import io.fd.vpp.jvpp.core.future.FutureJVppCore;
import java.util.concurrent.CompletableFuture;
import javax.annotation.Nonnull;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170518.gpe.feature.data.grouping.GpeFeatureData;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170801.gpe.feature.data.grouping.GpeFeatureData;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
diff --git a/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/gpe/translate/write/GpeForwardEntryCustomizer.java b/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/gpe/translate/write/GpeForwardEntryCustomizer.java
index cdd388776..28a0e1a37 100644
--- a/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/gpe/translate/write/GpeForwardEntryCustomizer.java
+++ b/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/gpe/translate/write/GpeForwardEntryCustomizer.java
@@ -17,14 +17,11 @@
package io.fd.hc2vpp.lisp.gpe.translate.write;
import static com.google.common.base.Preconditions.checkArgument;
-import static com.google.common.base.Preconditions.checkNotNull;
-import static io.fd.hc2vpp.lisp.gpe.translate.ctx.GpeLocatorPair.fromLocatorPair;
import static java.util.Objects.nonNull;
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.lisp.gpe.translate.ctx.GpeLocatorPairMappingContext;
import io.fd.hc2vpp.lisp.gpe.translate.service.GpeStateCheckService;
import io.fd.hc2vpp.lisp.translate.read.dump.executor.params.MappingsDumpParams.EidType;
import io.fd.hc2vpp.lisp.translate.util.EidTranslator;
@@ -37,19 +34,17 @@ import io.fd.vpp.jvpp.core.dto.GpeAddDelFwdEntryReply;
import io.fd.vpp.jvpp.core.future.FutureJVppCore;
import io.fd.vpp.jvpp.core.types.GpeLocator;
import java.util.Collection;
-import java.util.Collections;
import java.util.List;
import java.util.Optional;
import java.util.concurrent.CompletableFuture;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import javax.annotation.Nonnull;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170518.gpe.entry.table.grouping.gpe.entry.table.GpeEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170518.gpe.entry.table.grouping.gpe.entry.table.GpeEntryKey;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170518.gpe.entry.table.grouping.gpe.entry.table.gpe.entry.LocalEid;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170518.gpe.entry.table.grouping.gpe.entry.table.gpe.entry.LocatorPairs;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170518.gpe.entry.table.grouping.gpe.entry.table.gpe.entry.RemoteEid;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170518.locator.pair.LocatorPair;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170801.gpe.entry.table.grouping.gpe.entry.table.GpeEntry;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170801.gpe.entry.table.grouping.gpe.entry.table.GpeEntryKey;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170801.gpe.entry.table.grouping.gpe.entry.table.gpe.entry.LocalEid;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170801.gpe.entry.table.grouping.gpe.entry.table.gpe.entry.RemoteEid;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170801.locator.pairs.grouping.LocatorPair;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
public class GpeForwardEntryCustomizer extends FutureJVppCustomizer
@@ -57,16 +52,13 @@ public class GpeForwardEntryCustomizer extends FutureJVppCustomizer
private final GpeStateCheckService gpeStateCheckService;
private final NamingContext entryMappingCtx;
- private final GpeLocatorPairMappingContext locatorPairCtx;
public GpeForwardEntryCustomizer(@Nonnull final FutureJVppCore futureJVppCore,
@Nonnull final GpeStateCheckService gpeStateCheckService,
- @Nonnull final NamingContext entryMappingCtx,
- @Nonnull final GpeLocatorPairMappingContext locatorPairCtx) {
+ @Nonnull final NamingContext entryMappingCtx) {
super(futureJVppCore);
this.gpeStateCheckService = gpeStateCheckService;
this.entryMappingCtx = entryMappingCtx;
- this.locatorPairCtx = locatorPairCtx;
}
@Override
@@ -115,20 +107,13 @@ public class GpeForwardEntryCustomizer extends FutureJVppCustomizer
final GpeAddDelFwdEntryReply reply,
final MappingContext mappingContext){
/*
- * sync to disallow synchronization issues
+ * sync to prevent synchronization issues
*/
synchronized (entryMappingCtx) {
- synchronized (locatorPairCtx) {
- if (add) {
- entryMappingCtx.addName(reply.fwdEntryIndex,data.getId(),mappingContext);
- Optional.ofNullable(data.getLocatorPairs()).orElse(Collections.emptyList()).forEach(
- locatorPair -> locatorPairCtx
- .addMapping(data.getId(), locatorPair.getId(), fromLocatorPair(locatorPair),
- mappingContext));
- } else {
- entryMappingCtx.removeName(data.getId(),mappingContext);
- locatorPairCtx.removeMapping(data.getId(), mappingContext);
- }
+ if (add) {
+ entryMappingCtx.addName(reply.fwdEntryIndex, data.getId(), mappingContext);
+ } else {
+ entryMappingCtx.removeName(data.getId(), mappingContext);
}
}
}
@@ -162,8 +147,8 @@ public class GpeForwardEntryCustomizer extends FutureJVppCustomizer
request.action = (byte) entry.getAction().getIntValue();
}
- if (nonNull(entry.getLocatorPairs())) {
- request.locs = toRequestLocators(entry.getLocatorPairs());
+ if (nonNull(entry.getLocatorPair())) {
+ request.locs = toRequestLocators(entry.getLocatorPair());
request.locNum = request.locs.length;
}
@@ -174,12 +159,9 @@ public class GpeForwardEntryCustomizer extends FutureJVppCustomizer
// Locators vector must be ordered in way that local locators are first ,then remote.
// Pair is translated to two locators, one(local) with local address and weight, second one(remote) with remote
// address
- private GpeLocator[] toRequestLocators(final List<LocatorPairs> pairs) {
+ private GpeLocator[] toRequestLocators(final List<LocatorPair> pairs) {
final List<GpeLocator> localLocators = pairs.stream()
- .map(locatorPairContainer -> {
- final LocatorPair locatorPair =
- checkNotNull(locatorPairContainer.getLocatorPair(), "Locator pair cannot be null");
-
+ .map(locatorPair -> {
final boolean isLocalIpv6 = isIpv6(locatorPair.getLocalLocator());
final boolean isRemoteIpv6 = isIpv6(locatorPair.getRemoteLocator());
@@ -195,18 +177,15 @@ public class GpeForwardEntryCustomizer extends FutureJVppCustomizer
}).collect(Collectors.toList());
final List<GpeLocator> remoteLocators = pairs.stream()
- .map(locatorPairContainer -> {
- final LocatorPair locatorPair = locatorPairContainer.getLocatorPair();
-
+ .map(locatorPair -> {
final boolean isRemoteIpv6 = isIpv6(locatorPair.getRemoteLocator());
-
GpeLocator remoteLocator = new GpeLocator();
remoteLocator.addr = ipAddressToArray(locatorPair.getRemoteLocator());
remoteLocator.isIp4 = booleanToByte(!isRemoteIpv6);
return remoteLocator;
}).collect(Collectors.toList());
- return Stream.of(localLocators,remoteLocators).flatMap(Collection::stream).toArray(GpeLocator[]::new);
+ return Stream.of(localLocators, remoteLocators).flatMap(Collection::stream).toArray(GpeLocator[]::new);
}
}
diff --git a/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/gpe/translate/write/GpeWriterFactory.java b/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/gpe/translate/write/GpeWriterFactory.java
index 18bea7c9d..049f4acb4 100644
--- a/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/gpe/translate/write/GpeWriterFactory.java
+++ b/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/gpe/translate/write/GpeWriterFactory.java
@@ -21,7 +21,6 @@ import com.google.inject.Inject;
import com.google.inject.name.Named;
import io.fd.hc2vpp.common.translate.util.NamingContext;
import io.fd.hc2vpp.lisp.gpe.GpeModule;
-import io.fd.hc2vpp.lisp.gpe.translate.ctx.GpeLocatorPairMappingContext;
import io.fd.hc2vpp.lisp.gpe.translate.service.GpeStateCheckService;
import io.fd.honeycomb.translate.impl.write.GenericListWriter;
import io.fd.honeycomb.translate.impl.write.GenericWriter;
@@ -31,17 +30,16 @@ import io.fd.vpp.jvpp.core.future.FutureJVppCore;
import javax.annotation.Nonnull;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.Interfaces;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.Interface;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170518.Gpe;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170518.NativeForwardPathsTables;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170518._native.forward.paths.tables.NativeForwardPathsTable;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170518._native.forward.paths.tables._native.forward.paths.table.NativeForwardPath;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170518.gpe.entry.table.grouping.GpeEntryTable;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170518.gpe.entry.table.grouping.gpe.entry.table.GpeEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170518.gpe.entry.table.grouping.gpe.entry.table.gpe.entry.LocalEid;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170518.gpe.entry.table.grouping.gpe.entry.table.gpe.entry.LocatorPairs;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170518.gpe.entry.table.grouping.gpe.entry.table.gpe.entry.RemoteEid;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170518.gpe.feature.data.grouping.GpeFeatureData;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170518.locator.pair.LocatorPair;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170801.Gpe;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170801.NativeForwardPathsTables;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170801._native.forward.paths.tables.NativeForwardPathsTable;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170801._native.forward.paths.tables._native.forward.paths.table.NativeForwardPath;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170801.gpe.entry.table.grouping.GpeEntryTable;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170801.gpe.entry.table.grouping.gpe.entry.table.GpeEntry;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170801.gpe.entry.table.grouping.gpe.entry.table.gpe.entry.LocalEid;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170801.gpe.entry.table.grouping.gpe.entry.table.gpe.entry.RemoteEid;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170801.gpe.feature.data.grouping.GpeFeatureData;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170801.locator.pairs.grouping.LocatorPair;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev170607.SubinterfaceAugmentation;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev170607.interfaces._interface.SubInterfaces;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev170607.interfaces._interface.sub.interfaces.SubInterface;
@@ -69,10 +67,6 @@ public class GpeWriterFactory implements WriterFactory {
private NamingContext gpeEntryMappingContext;
@Inject
- @Named(GpeModule.GPE_TO_LOCATOR_PAIR_CTX)
- private GpeLocatorPairMappingContext gpeLocatorPairMappingContext;
-
- @Inject
@Named("interface-context")
private NamingContext interfaceContext;
@@ -91,11 +85,9 @@ public class GpeWriterFactory implements WriterFactory {
registry.subtreeAddBefore(ImmutableSet.of(
entrySubtreeId.child(LocalEid.class),
entrySubtreeId.child(RemoteEid.class),
- entrySubtreeId.child(LocatorPairs.class),
- entrySubtreeId.child(LocatorPairs.class).child(LocatorPair.class)),
+ entrySubtreeId.child(LocatorPair.class)),
new GenericListWriter<>(GPE_ENTRY_ID,
- new GpeForwardEntryCustomizer(api, gpeStateCheckService, gpeEntryMappingContext,
- gpeLocatorPairMappingContext)),
+ new GpeForwardEntryCustomizer(api, gpeStateCheckService, gpeEntryMappingContext)),
IFC_ID.augmentation(SubinterfaceAugmentation.class).child(SubInterfaces.class)
.child(SubInterface.class));
diff --git a/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/gpe/translate/write/NativeForwardPathCustomizer.java b/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/gpe/translate/write/NativeForwardPathCustomizer.java
index 0dcb434e4..cbb4b2f97 100644
--- a/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/gpe/translate/write/NativeForwardPathCustomizer.java
+++ b/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/gpe/translate/write/NativeForwardPathCustomizer.java
@@ -31,8 +31,8 @@ import io.fd.vpp.jvpp.core.future.FutureJVppCore;
import java.util.Optional;
import javax.annotation.Nonnull;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170518._native.forward.paths.tables._native.forward.paths.table.NativeForwardPath;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170518._native.forward.paths.tables._native.forward.paths.table.NativeForwardPathKey;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170801._native.forward.paths.tables._native.forward.paths.table.NativeForwardPath;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170801._native.forward.paths.tables._native.forward.paths.table.NativeForwardPathKey;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
public class NativeForwardPathCustomizer extends FutureJVppCustomizer
diff --git a/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/gpe/translate/write/NativeForwardPathsTableCustomizer.java b/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/gpe/translate/write/NativeForwardPathsTableCustomizer.java
index a9030a7c4..6d2faf297 100644
--- a/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/gpe/translate/write/NativeForwardPathsTableCustomizer.java
+++ b/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/gpe/translate/write/NativeForwardPathsTableCustomizer.java
@@ -25,8 +25,8 @@ import io.fd.honeycomb.translate.write.WriteFailedException;
import io.fd.vpp.jvpp.core.dto.GpeAddDelIface;
import io.fd.vpp.jvpp.core.future.FutureJVppCore;
import javax.annotation.Nonnull;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170518._native.forward.paths.tables.NativeForwardPathsTable;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170518._native.forward.paths.tables.NativeForwardPathsTableKey;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170801._native.forward.paths.tables.NativeForwardPathsTable;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170801._native.forward.paths.tables.NativeForwardPathsTableKey;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
diff --git a/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/util/EidTranslator.java b/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/util/EidTranslator.java
index 2b693fd60..ab0467024 100755
--- a/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/util/EidTranslator.java
+++ b/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/util/EidTranslator.java
@@ -93,11 +93,11 @@ public interface EidTranslator extends AddressTranslator, EidMetadataProvider {
return resolverPrefixLength(address.getAddress());
}
- default byte getPrefixLength(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170518.gpe.entry.table.grouping.gpe.entry.table.gpe.entry.LocalEid address){
+ default byte getPrefixLength(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170801.gpe.entry.table.grouping.gpe.entry.table.gpe.entry.LocalEid address){
return resolverPrefixLength(address.getAddress());
}
- default byte getPrefixLength(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170518.gpe.entry.table.grouping.gpe.entry.table.gpe.entry.RemoteEid address){
+ default byte getPrefixLength(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170801.gpe.entry.table.grouping.gpe.entry.table.gpe.entry.RemoteEid address){
return resolverPrefixLength(address.getAddress());
}
@@ -123,22 +123,22 @@ public interface EidTranslator extends AddressTranslator, EidMetadataProvider {
return Byte.valueOf(data.substring(data.indexOf('/') + 1));
}
- default org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170518.gpe.entry.table.grouping.gpe.entry.table.gpe.entry.LocalEid getArrayAsGpeLocalEid(
+ default org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170801.gpe.entry.table.grouping.gpe.entry.table.gpe.entry.LocalEid getArrayAsGpeLocalEid(
@Nonnull final EidType type, final byte[] address, final byte prefix, final int vni) {
final Eid eid = getArrayAsEidLocal(type, address, prefix, vni);
- return new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170518.gpe.entry.table.grouping.gpe.entry.table.gpe.entry.LocalEidBuilder()
+ return new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170801.gpe.entry.table.grouping.gpe.entry.table.gpe.entry.LocalEidBuilder()
.setAddress(eid.getAddress())
.setAddressType(eid.getAddressType())
.setVirtualNetworkId(eid.getVirtualNetworkId())
.build();
}
- default org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170518.gpe.entry.table.grouping.gpe.entry.table.gpe.entry.RemoteEid getArrayAsGpeRemoteEid(
+ default org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170801.gpe.entry.table.grouping.gpe.entry.table.gpe.entry.RemoteEid getArrayAsGpeRemoteEid(
@Nonnull final EidType type, final byte[] address, final byte prefix, final int vni) {
final Eid eid = getArrayAsEidLocal(type, address, prefix, vni);
- return new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170518.gpe.entry.table.grouping.gpe.entry.table.gpe.entry.RemoteEidBuilder()
+ return new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170801.gpe.entry.table.grouping.gpe.entry.table.gpe.entry.RemoteEidBuilder()
.setAddress(eid.getAddress())
.setAddressType(eid.getAddressType())
.setVirtualNetworkId(eid.getVirtualNetworkId())
@@ -358,14 +358,14 @@ public interface EidTranslator extends AddressTranslator, EidMetadataProvider {
}
default EidType getEidType(
- org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170518.gpe.entry.table.grouping.gpe.entry.table.gpe.entry.RemoteEid address) {
+ org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170801.gpe.entry.table.grouping.gpe.entry.table.gpe.entry.RemoteEid address) {
checkNotNull(address, "Address cannot be null");
return resolveType(address.getAddress());
}
default EidType getEidType(
- org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170518.gpe.entry.table.grouping.gpe.entry.table.gpe.entry.LocalEid address) {
+ org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170801.gpe.entry.table.grouping.gpe.entry.table.gpe.entry.LocalEid address) {
checkNotNull(address, "Address cannot be null");
return resolveType(address.getAddress());
@@ -425,14 +425,14 @@ public interface EidTranslator extends AddressTranslator, EidMetadataProvider {
}
default byte[] getEidAsByteArray(
- org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170518.gpe.entry.table.grouping.gpe.entry.table.gpe.entry.RemoteEid address) {
+ org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170801.gpe.entry.table.grouping.gpe.entry.table.gpe.entry.RemoteEid address) {
checkNotNull(address, "Eid cannot be null");
return resolveByteArray(getEidType(address), address.getAddress());
}
default byte[] getEidAsByteArray(
- org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170518.gpe.entry.table.grouping.gpe.entry.table.gpe.entry.LocalEid address) {
+ org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170801.gpe.entry.table.grouping.gpe.entry.table.gpe.entry.LocalEid address) {
checkNotNull(address, "Eid cannot be null");
return resolveByteArray(getEidType(address), address.getAddress());