diff options
author | Marek Gradzki <mgradzki@cisco.com> | 2017-08-23 14:18:51 +0200 |
---|---|---|
committer | Jan Srnicek <jsrnicek@cisco.com> | 2017-08-24 15:08:00 +0200 |
commit | 36ed0b50449248a3276ebf149dd5c8105e0ba3fc (patch) | |
tree | a38e80b0f7743928e694db0d0747d65179878a6d /nat/nat2vpp/src/main | |
parent | 31996a6707d75a5f87f7d8c89f563af74e32fe70 (diff) |
HC2VPP-222: adapt hc2vpp to snat->nat plugin rename in vpp
Change-Id: If4c7f2f1fc52f1ee64ed95900a362063207def27
Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
Diffstat (limited to 'nat/nat2vpp/src/main')
26 files changed, 215 insertions, 217 deletions
diff --git a/nat/nat2vpp/src/main/java/io/fd/hc2vpp/nat/NatModule.java b/nat/nat2vpp/src/main/java/io/fd/hc2vpp/nat/NatModule.java index fece7b011..bfc502e89 100644 --- a/nat/nat2vpp/src/main/java/io/fd/hc2vpp/nat/NatModule.java +++ b/nat/nat2vpp/src/main/java/io/fd/hc2vpp/nat/NatModule.java @@ -21,7 +21,7 @@ import com.google.inject.AbstractModule; import com.google.inject.Provider; import com.google.inject.Singleton; import com.google.inject.multibindings.Multibinder; -import io.fd.hc2vpp.nat.jvpp.JVppSnatProvider; +import io.fd.hc2vpp.nat.jvpp.JVppNatProvider; import io.fd.hc2vpp.nat.read.NatReaderFactory; import io.fd.hc2vpp.nat.read.ifc.IfcNatReaderFactory; import io.fd.hc2vpp.nat.read.ifc.SubIfcNatReaderFactory; @@ -31,7 +31,7 @@ import io.fd.hc2vpp.nat.write.ifc.IfcNatWriterFactory; import io.fd.hc2vpp.nat.write.ifc.SubIfcNatWriterFactory; import io.fd.honeycomb.translate.read.ReaderFactory; import io.fd.honeycomb.translate.write.WriterFactory; -import io.fd.vpp.jvpp.snat.future.FutureJVppSnatFacade; +import io.fd.vpp.jvpp.nat.future.FutureJVppNatFacade; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -41,15 +41,15 @@ import org.slf4j.LoggerFactory; public class NatModule extends AbstractModule { private static final Logger LOG = LoggerFactory.getLogger(NatModule.class); - private final Class<? extends Provider<FutureJVppSnatFacade>> jvppSnatProviderClass; + private final Class<? extends Provider<FutureJVppNatFacade>> jvppNatProviderClass; public NatModule() { - this(JVppSnatProvider.class); + this(JVppNatProvider.class); } @VisibleForTesting - protected NatModule(Class<? extends Provider<FutureJVppSnatFacade>> jvppSnatProvider) { - this.jvppSnatProviderClass = jvppSnatProvider; + protected NatModule(Class<? extends Provider<FutureJVppNatFacade>> jvppNatProvider) { + this.jvppNatProviderClass = jvppNatProvider; } @Override @@ -60,7 +60,7 @@ public class NatModule extends AbstractModule { LOG.debug("Installing NAT module"); // Bind to Plugin's JVPP - bind(FutureJVppSnatFacade.class).toProvider(jvppSnatProviderClass).in(Singleton.class); + bind(FutureJVppNatFacade.class).toProvider(jvppNatProviderClass).in(Singleton.class); final Multibinder<ReaderFactory> readBinder = Multibinder.newSetBinder(binder(), ReaderFactory.class); readBinder.addBinding().to(IfcNatReaderFactory.class).in(Singleton.class); diff --git a/nat/nat2vpp/src/main/java/io/fd/hc2vpp/nat/jvpp/JVppSnatProvider.java b/nat/nat2vpp/src/main/java/io/fd/hc2vpp/nat/jvpp/JVppNatProvider.java index d1a1b766c..97c5ebb3e 100755 --- a/nat/nat2vpp/src/main/java/io/fd/hc2vpp/nat/jvpp/JVppSnatProvider.java +++ b/nat/nat2vpp/src/main/java/io/fd/hc2vpp/nat/jvpp/JVppNatProvider.java @@ -20,8 +20,8 @@ import com.google.inject.Inject; import io.fd.honeycomb.binding.init.ProviderTrait; import io.fd.honeycomb.data.init.ShutdownHandler; import io.fd.vpp.jvpp.JVppRegistry; -import io.fd.vpp.jvpp.snat.JVppSnatImpl; -import io.fd.vpp.jvpp.snat.future.FutureJVppSnatFacade; +import io.fd.vpp.jvpp.nat.JVppNatImpl; +import io.fd.vpp.jvpp.nat.future.FutureJVppNatFacade; import java.io.IOException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -30,9 +30,9 @@ import org.slf4j.LoggerFactory; * Provides future API for jvpp-nsh plugin. Must be a singleton due to shutdown hook usage. Registers shutdown hook to * free plugin's resources on shutdown. */ -public final class JVppSnatProvider extends ProviderTrait<FutureJVppSnatFacade> { +public final class JVppNatProvider extends ProviderTrait<FutureJVppNatFacade> { - private static final Logger LOG = LoggerFactory.getLogger(JVppSnatProvider.class); + private static final Logger LOG = LoggerFactory.getLogger(JVppNatProvider.class); @Inject private JVppRegistry registry; @@ -41,14 +41,14 @@ public final class JVppSnatProvider extends ProviderTrait<FutureJVppSnatFacade> private ShutdownHandler shutdownHandler; @Override - protected FutureJVppSnatFacade create() { + protected FutureJVppNatFacade create() { try { - final JVppSnatImpl jvppSnat = new JVppSnatImpl(); + final JVppNatImpl jvppNat = new JVppNatImpl(); // Free jvpp-nsh plugin's resources on shutdown - shutdownHandler.register("jvpp-snat", jvppSnat); + shutdownHandler.register("jvpp-nat", jvppNat); - LOG.info("Successfully loaded jvpp-snat plugin"); - return new FutureJVppSnatFacade(registry, jvppSnat); + LOG.info("Successfully loaded jvpp-nat plugin"); + return new FutureJVppNatFacade(registry, jvppNat); } catch (IOException e) { throw new IllegalStateException("Unable to open VPP management connection", e); } diff --git a/nat/nat2vpp/src/main/java/io/fd/hc2vpp/nat/read/ExternalIpPoolCustomizer.java b/nat/nat2vpp/src/main/java/io/fd/hc2vpp/nat/read/ExternalIpPoolCustomizer.java index 451c694d1..0fd149e5a 100644 --- a/nat/nat2vpp/src/main/java/io/fd/hc2vpp/nat/read/ExternalIpPoolCustomizer.java +++ b/nat/nat2vpp/src/main/java/io/fd/hc2vpp/nat/read/ExternalIpPoolCustomizer.java @@ -26,13 +26,13 @@ import io.fd.honeycomb.translate.spi.read.Initialized; import io.fd.honeycomb.translate.spi.read.InitializingListReaderCustomizer; import io.fd.honeycomb.translate.util.RWUtils; import io.fd.honeycomb.translate.util.read.cache.DumpCacheManager; -import io.fd.vpp.jvpp.snat.dto.Nat64PoolAddrDetails; -import io.fd.vpp.jvpp.snat.dto.Nat64PoolAddrDetailsReplyDump; -import io.fd.vpp.jvpp.snat.dto.Nat64PoolAddrDump; -import io.fd.vpp.jvpp.snat.dto.SnatAddressDetails; -import io.fd.vpp.jvpp.snat.dto.SnatAddressDetailsReplyDump; -import io.fd.vpp.jvpp.snat.dto.SnatAddressDump; -import io.fd.vpp.jvpp.snat.future.FutureJVppSnatFacade; +import io.fd.vpp.jvpp.nat.dto.Nat44AddressDetails; +import io.fd.vpp.jvpp.nat.dto.Nat44AddressDetailsReplyDump; +import io.fd.vpp.jvpp.nat.dto.Nat44AddressDump; +import io.fd.vpp.jvpp.nat.dto.Nat64PoolAddrDetails; +import io.fd.vpp.jvpp.nat.dto.Nat64PoolAddrDetailsReplyDump; +import io.fd.vpp.jvpp.nat.dto.Nat64PoolAddrDump; +import io.fd.vpp.jvpp.nat.future.FutureJVppNatFacade; import java.util.Collections; import java.util.List; import java.util.stream.Collectors; @@ -60,17 +60,17 @@ final class ExternalIpPoolCustomizer implements private static final Logger LOG = LoggerFactory.getLogger(ExternalIpPoolCustomizer.class); - private final DumpCacheManager<SnatAddressDetailsReplyDump, Void> nat44DumpMgr; + private final DumpCacheManager<Nat44AddressDetailsReplyDump, Void> nat44DumpMgr; private final DumpCacheManager<Nat64PoolAddrDetailsReplyDump, Void> nat64DumpMgr; - ExternalIpPoolCustomizer(@Nonnull final FutureJVppSnatFacade jvppSnat) { - checkNotNull(jvppSnat, "jvppSnat should not be null"); - this.nat44DumpMgr = new DumpCacheManager.DumpCacheManagerBuilder<SnatAddressDetailsReplyDump, Void>() - .withExecutor((id, params) -> getReplyForRead(jvppSnat.snatAddressDump(new SnatAddressDump()).toCompletableFuture(), id)) - .acceptOnly(SnatAddressDetailsReplyDump.class) + ExternalIpPoolCustomizer(@Nonnull final FutureJVppNatFacade jvppNat) { + checkNotNull(jvppNat, "jvppNat should not be null"); + this.nat44DumpMgr = new DumpCacheManager.DumpCacheManagerBuilder<Nat44AddressDetailsReplyDump, Void>() + .withExecutor((id, params) -> getReplyForRead(jvppNat.nat44AddressDump(new Nat44AddressDump()).toCompletableFuture(), id)) + .acceptOnly(Nat44AddressDetailsReplyDump.class) .build(); this.nat64DumpMgr = new DumpCacheManager.DumpCacheManagerBuilder<Nat64PoolAddrDetailsReplyDump, Void>() - .withExecutor((id, params) -> getReplyForRead(jvppSnat.nat64PoolAddrDump(new Nat64PoolAddrDump()).toCompletableFuture(), id)) + .withExecutor((id, params) -> getReplyForRead(jvppNat.nat64PoolAddrDump(new Nat64PoolAddrDump()).toCompletableFuture(), id)) .acceptOnly(Nat64PoolAddrDetailsReplyDump.class) .build(); } @@ -98,14 +98,14 @@ final class ExternalIpPoolCustomizer implements LOG.trace("Reading current attributes for external IP pool: {}", id); final Long poolId = id.firstKeyOf(ExternalIpAddressPool.class).getPoolId(); - final List<SnatAddressDetails> nat44Details = + final List<Nat44AddressDetails> nat44Details = nat44DumpMgr.getDump(id, ctx.getModificationCache(), null) - .or(new SnatAddressDetailsReplyDump()).snatAddressDetails; + .or(new Nat44AddressDetailsReplyDump()).nat44AddressDetails; final int nat44PoolCount = nat44Details.size(); // Uses ID<->address mapping as defined by getAllIds (nat44 mappings go before nat64): if (poolId < nat44PoolCount) { - final SnatAddressDetails detail = nat44Details.get(Math.toIntExact(poolId)); + final Nat44AddressDetails detail = nat44Details.get(Math.toIntExact(poolId)); readPoolIp(builder, detail.ipAddress); setPoolType(builder, NatPoolType.Nat44); } else { @@ -153,7 +153,7 @@ final class ExternalIpPoolCustomizer implements // this customizer also returns every single address as a 32 prefix and assigns an artificial key to them long addressCount = nat44DumpMgr.getDump(id, ctx.getModificationCache(), null) - .or(new SnatAddressDetailsReplyDump()).snatAddressDetails.stream() + .or(new Nat44AddressDetailsReplyDump()).nat44AddressDetails.stream() .count(); // The ietf-nat model groups address pools for Nat44 and Nat64 under the same list, diff --git a/nat/nat2vpp/src/main/java/io/fd/hc2vpp/nat/read/MappingEntryCustomizer.java b/nat/nat2vpp/src/main/java/io/fd/hc2vpp/nat/read/MappingEntryCustomizer.java index 2732c5fcc..8f22b756f 100644 --- a/nat/nat2vpp/src/main/java/io/fd/hc2vpp/nat/read/MappingEntryCustomizer.java +++ b/nat/nat2vpp/src/main/java/io/fd/hc2vpp/nat/read/MappingEntryCustomizer.java @@ -27,13 +27,13 @@ import io.fd.honeycomb.translate.spi.read.InitializingListReaderCustomizer; import io.fd.honeycomb.translate.util.RWUtils; import io.fd.honeycomb.translate.util.read.cache.DumpCacheManager; import io.fd.honeycomb.translate.util.read.cache.EntityDumpExecutor; -import io.fd.vpp.jvpp.snat.dto.Nat64BibDetails; -import io.fd.vpp.jvpp.snat.dto.Nat64BibDetailsReplyDump; -import io.fd.vpp.jvpp.snat.dto.Nat64BibDump; -import io.fd.vpp.jvpp.snat.dto.SnatStaticMappingDetails; -import io.fd.vpp.jvpp.snat.dto.SnatStaticMappingDetailsReplyDump; -import io.fd.vpp.jvpp.snat.dto.SnatStaticMappingDump; -import io.fd.vpp.jvpp.snat.future.FutureJVppSnatFacade; +import io.fd.vpp.jvpp.nat.dto.Nat44StaticMappingDetails; +import io.fd.vpp.jvpp.nat.dto.Nat44StaticMappingDetailsReplyDump; +import io.fd.vpp.jvpp.nat.dto.Nat44StaticMappingDump; +import io.fd.vpp.jvpp.nat.dto.Nat64BibDetails; +import io.fd.vpp.jvpp.nat.dto.Nat64BibDetailsReplyDump; +import io.fd.vpp.jvpp.nat.dto.Nat64BibDump; +import io.fd.vpp.jvpp.nat.future.FutureJVppNatFacade; import java.util.List; import java.util.Optional; import java.util.stream.Collectors; @@ -60,12 +60,12 @@ final class MappingEntryCustomizer implements Ipv4Translator, Ipv6Translator, private static final Logger LOG = LoggerFactory.getLogger(MappingEntryCustomizer.class); - private final DumpCacheManager<SnatStaticMappingDetailsReplyDump, Void> nat44DumpManager; + private final DumpCacheManager<Nat44StaticMappingDetailsReplyDump, Void> nat44DumpManager; private final DumpCacheManager<Nat64BibDetailsReplyDump, Void> nat64DumpManager; private final MappingEntryContext mappingEntryContext; MappingEntryCustomizer( - final DumpCacheManager<SnatStaticMappingDetailsReplyDump, Void> nat44DumpManager, + final DumpCacheManager<Nat44StaticMappingDetailsReplyDump, Void> nat44DumpManager, final DumpCacheManager<Nat64BibDetailsReplyDump, Void> nat64DumpManager, final MappingEntryContext mappingEntryContext) { this.nat44DumpManager = nat44DumpManager; @@ -87,24 +87,24 @@ final class MappingEntryCustomizer implements Ipv4Translator, Ipv6Translator, final int idx = id.firstKeyOf(MappingEntry.class).getIndex().intValue(); final int natInstanceId = id.firstKeyOf(NatInstance.class).getId().intValue(); - final List<SnatStaticMappingDetails> nat44Details = + final List<Nat44StaticMappingDetails> nat44Details = nat44DumpManager.getDump(id, ctx.getModificationCache(), null) - .or(new SnatStaticMappingDetailsReplyDump()).snatStaticMappingDetails; - final Optional<SnatStaticMappingDetails> snat44StaticMappingDetails = + .or(new Nat44StaticMappingDetailsReplyDump()).nat44StaticMappingDetails; + final Optional<Nat44StaticMappingDetails> nat44StaticMappingDetails = mappingEntryContext.findDetailsNat44(nat44Details, natInstanceId, idx, ctx.getMappingContext()); - if (snat44StaticMappingDetails.isPresent()) { - readNat44Entry(builder, idx, snat44StaticMappingDetails.get()); + if (nat44StaticMappingDetails.isPresent()) { + readNat44Entry(builder, idx, nat44StaticMappingDetails.get()); } else { final List<Nat64BibDetails> nat64Details = nat64DumpManager.getDump(id, ctx.getModificationCache(), null) .or(new Nat64BibDetailsReplyDump()).nat64BibDetails; - final Optional<Nat64BibDetails> snat64StaticMappingDetails = + final Optional<Nat64BibDetails> nat64StaticMappingDetails = mappingEntryContext.findDetailsNat64(nat64Details, natInstanceId, idx, ctx.getMappingContext()); - if (snat64StaticMappingDetails.isPresent()) { - readNat64Entry(builder, idx, snat64StaticMappingDetails.get()); + if (nat64StaticMappingDetails.isPresent()) { + readNat64Entry(builder, idx, nat64StaticMappingDetails.get()); } } @@ -113,7 +113,7 @@ final class MappingEntryCustomizer implements Ipv4Translator, Ipv6Translator, } private void readNat44Entry(@Nonnull final MappingEntryBuilder builder, - final int index, final SnatStaticMappingDetails detail) { + final int index, final Nat44StaticMappingDetails detail) { builder.setIndex((long) index); builder.setType( org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.nat.rev150908.MappingEntry.Type.Static); @@ -170,7 +170,7 @@ final class MappingEntryCustomizer implements Ipv4Translator, Ipv6Translator, final List<MappingEntryKey> entryKeys = nat44DumpManager.getDump(id, context.getModificationCache(), null) - .or(new SnatStaticMappingDetailsReplyDump()).snatStaticMappingDetails.stream() + .or(new Nat44StaticMappingDetailsReplyDump()).nat44StaticMappingDetails.stream() .filter(detail -> natInstanceId == detail.vrfId) .map(detail -> mappingEntryContext .getStoredOrArtificialIndex(natInstanceId, detail, context.getMappingContext())) @@ -219,19 +219,19 @@ final class MappingEntryCustomizer implements Ipv4Translator, Ipv6Translator, } static final class MappingEntryNat44DumpExecutor - implements EntityDumpExecutor<SnatStaticMappingDetailsReplyDump, Void>, JvppReplyConsumer { + implements EntityDumpExecutor<Nat44StaticMappingDetailsReplyDump, Void>, JvppReplyConsumer { - private final FutureJVppSnatFacade jvppSnat; + private final FutureJVppNatFacade jvppNat; - MappingEntryNat44DumpExecutor(final FutureJVppSnatFacade jvppSnat) { - this.jvppSnat = jvppSnat; + MappingEntryNat44DumpExecutor(final FutureJVppNatFacade jvppNat) { + this.jvppNat = jvppNat; } @Nonnull @Override - public SnatStaticMappingDetailsReplyDump executeDump(final InstanceIdentifier<?> identifier, final Void params) + public Nat44StaticMappingDetailsReplyDump executeDump(final InstanceIdentifier<?> identifier, final Void params) throws ReadFailedException { - return getReplyForRead(jvppSnat.snatStaticMappingDump(new SnatStaticMappingDump()).toCompletableFuture(), + return getReplyForRead(jvppNat.nat44StaticMappingDump(new Nat44StaticMappingDump()).toCompletableFuture(), identifier); } } @@ -239,10 +239,10 @@ final class MappingEntryCustomizer implements Ipv4Translator, Ipv6Translator, static final class MappingEntryNat64DumpExecutor implements EntityDumpExecutor<Nat64BibDetailsReplyDump, Void>, JvppReplyConsumer { - private final FutureJVppSnatFacade jvppSnat; + private final FutureJVppNatFacade jvppNat; - MappingEntryNat64DumpExecutor(final FutureJVppSnatFacade jvppSnat) { - this.jvppSnat = jvppSnat; + MappingEntryNat64DumpExecutor(final FutureJVppNatFacade jvppNat) { + this.jvppNat = jvppNat; } @Nonnull @@ -251,7 +251,7 @@ final class MappingEntryCustomizer implements Ipv4Translator, Ipv6Translator, throws ReadFailedException { final Nat64BibDump dump = new Nat64BibDump(); dump.proto = -1; // dump entries for all protocols - return getReplyForRead(jvppSnat.nat64BibDump(dump).toCompletableFuture(), identifier); + return getReplyForRead(jvppNat.nat64BibDump(dump).toCompletableFuture(), identifier); } } } diff --git a/nat/nat2vpp/src/main/java/io/fd/hc2vpp/nat/read/NatInstanceCustomizer.java b/nat/nat2vpp/src/main/java/io/fd/hc2vpp/nat/read/NatInstanceCustomizer.java index 18a959274..8468289da 100644 --- a/nat/nat2vpp/src/main/java/io/fd/hc2vpp/nat/read/NatInstanceCustomizer.java +++ b/nat/nat2vpp/src/main/java/io/fd/hc2vpp/nat/read/NatInstanceCustomizer.java @@ -21,8 +21,8 @@ import io.fd.honeycomb.translate.read.ReadFailedException; import io.fd.honeycomb.translate.spi.read.Initialized; import io.fd.honeycomb.translate.spi.read.InitializingListReaderCustomizer; import io.fd.honeycomb.translate.util.read.cache.DumpCacheManager; -import io.fd.vpp.jvpp.snat.dto.Nat64BibDetailsReplyDump; -import io.fd.vpp.jvpp.snat.dto.SnatStaticMappingDetailsReplyDump; +import io.fd.vpp.jvpp.nat.dto.Nat44StaticMappingDetailsReplyDump; +import io.fd.vpp.jvpp.nat.dto.Nat64BibDetailsReplyDump; import java.util.List; import java.util.stream.Collectors; import java.util.stream.Stream; @@ -47,11 +47,11 @@ final class NatInstanceCustomizer private static final Logger LOG = LoggerFactory.getLogger(NatInstanceCustomizer.class); static final NatInstanceKey DEFAULT_VRF_ID = new NatInstanceKey(0L); - private final DumpCacheManager<SnatStaticMappingDetailsReplyDump, Void> nat44DumpManager; + private final DumpCacheManager<Nat44StaticMappingDetailsReplyDump, Void> nat44DumpManager; private final DumpCacheManager<Nat64BibDetailsReplyDump, Void> nat64DumpManager; NatInstanceCustomizer( - final DumpCacheManager<SnatStaticMappingDetailsReplyDump, Void> nat44DumpManager, + final DumpCacheManager<Nat44StaticMappingDetailsReplyDump, Void> nat44DumpManager, final DumpCacheManager<Nat64BibDetailsReplyDump, Void> nat64DumpManager) { this.nat44DumpManager = nat44DumpManager; this.nat64DumpManager = nat64DumpManager; @@ -80,7 +80,7 @@ final class NatInstanceCustomizer // Find the nat instance IDs (vrf-ids) by listing all static mappings and their VRF assignment final List<NatInstanceKey> vrfIds = Stream.concat( nat44DumpManager.getDump(id, context.getModificationCache(), null) - .or(new SnatStaticMappingDetailsReplyDump()).snatStaticMappingDetails.stream() + .or(new Nat44StaticMappingDetailsReplyDump()).nat44StaticMappingDetails.stream() .map(detail -> detail.vrfId), nat64DumpManager.getDump(id, context.getModificationCache(), null) .or(new Nat64BibDetailsReplyDump()).nat64BibDetails.stream() diff --git a/nat/nat2vpp/src/main/java/io/fd/hc2vpp/nat/read/NatReaderFactory.java b/nat/nat2vpp/src/main/java/io/fd/hc2vpp/nat/read/NatReaderFactory.java index d9c7f3380..754f19337 100644 --- a/nat/nat2vpp/src/main/java/io/fd/hc2vpp/nat/read/NatReaderFactory.java +++ b/nat/nat2vpp/src/main/java/io/fd/hc2vpp/nat/read/NatReaderFactory.java @@ -23,9 +23,9 @@ import io.fd.honeycomb.translate.impl.read.GenericInitListReader; import io.fd.honeycomb.translate.read.ReaderFactory; import io.fd.honeycomb.translate.read.registry.ModifiableReaderRegistryBuilder; import io.fd.honeycomb.translate.util.read.cache.DumpCacheManager; -import io.fd.vpp.jvpp.snat.dto.Nat64BibDetailsReplyDump; -import io.fd.vpp.jvpp.snat.dto.SnatStaticMappingDetailsReplyDump; -import io.fd.vpp.jvpp.snat.future.FutureJVppSnatFacade; +import io.fd.vpp.jvpp.nat.dto.Nat44StaticMappingDetailsReplyDump; +import io.fd.vpp.jvpp.nat.dto.Nat64BibDetailsReplyDump; +import io.fd.vpp.jvpp.nat.future.FutureJVppNatFacade; import javax.annotation.Nonnull; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.nat.rev150908.NatState; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.nat.rev150908.NatStateBuilder; @@ -52,25 +52,25 @@ public class NatReaderFactory implements ReaderFactory { private static final InstanceIdentifier<MappingTable> MAP_TABLE_ID = NAT_INSTANCE_ID.child(MappingTable.class); private static final InstanceIdentifier<MappingEntry> MAP_ENTRY_ID = MAP_TABLE_ID.child(MappingEntry.class); - private final FutureJVppSnatFacade jvppSnat; + private final FutureJVppNatFacade jvppNat; private final MappingEntryContext mappingEntryContext; - private final DumpCacheManager<SnatStaticMappingDetailsReplyDump, Void> mapEntryNat44DumpMgr; + private final DumpCacheManager<Nat44StaticMappingDetailsReplyDump, Void> mapEntryNat44DumpMgr; private final DumpCacheManager<Nat64BibDetailsReplyDump, Void> mapEntryNat64DumpMgr; @Inject - public NatReaderFactory(final FutureJVppSnatFacade jvppSnat, + public NatReaderFactory(final FutureJVppNatFacade jvppNat, final MappingEntryContext mappingEntryContext) { - this.jvppSnat = jvppSnat; + this.jvppNat = jvppNat; this.mappingEntryContext = mappingEntryContext; this.mapEntryNat44DumpMgr = - new DumpCacheManager.DumpCacheManagerBuilder<SnatStaticMappingDetailsReplyDump, Void>() - .withExecutor(new MappingEntryCustomizer.MappingEntryNat44DumpExecutor(jvppSnat)) - .acceptOnly(SnatStaticMappingDetailsReplyDump.class) + new DumpCacheManager.DumpCacheManagerBuilder<Nat44StaticMappingDetailsReplyDump, Void>() + .withExecutor(new MappingEntryCustomizer.MappingEntryNat44DumpExecutor(jvppNat)) + .acceptOnly(Nat44StaticMappingDetailsReplyDump.class) .build(); this.mapEntryNat64DumpMgr = new DumpCacheManager.DumpCacheManagerBuilder<Nat64BibDetailsReplyDump, Void>() - .withExecutor(new MappingEntryCustomizer.MappingEntryNat64DumpExecutor(jvppSnat)) + .withExecutor(new MappingEntryCustomizer.MappingEntryNat64DumpExecutor(jvppNat)) .acceptOnly(Nat64BibDetailsReplyDump.class) .build(); } @@ -89,6 +89,6 @@ public class NatReaderFactory implements ReaderFactory { registry.addStructuralReader(CURRENT_CONFIG, NatCurrentConfigBuilder.class); registry.add(new GenericInitListReader<>(CURRENT_CONFIG.child(ExternalIpAddressPool.class), - new ExternalIpPoolCustomizer(jvppSnat))); + new ExternalIpPoolCustomizer(jvppNat))); } } diff --git a/nat/nat2vpp/src/main/java/io/fd/hc2vpp/nat/read/ifc/AbstractInterfaceNatCustomizer.java b/nat/nat2vpp/src/main/java/io/fd/hc2vpp/nat/read/ifc/AbstractInterfaceNatCustomizer.java index 5079f1630..3ef2035e4 100644 --- a/nat/nat2vpp/src/main/java/io/fd/hc2vpp/nat/read/ifc/AbstractInterfaceNatCustomizer.java +++ b/nat/nat2vpp/src/main/java/io/fd/hc2vpp/nat/read/ifc/AbstractInterfaceNatCustomizer.java @@ -25,13 +25,13 @@ import io.fd.honeycomb.translate.read.ReadContext; import io.fd.honeycomb.translate.read.ReadFailedException; import io.fd.honeycomb.translate.spi.read.InitializingReaderCustomizer; import io.fd.honeycomb.translate.util.read.cache.DumpCacheManager; -import io.fd.vpp.jvpp.snat.dto.Nat64InterfaceDetailsReplyDump; -import io.fd.vpp.jvpp.snat.dto.Nat64InterfaceDump; -import io.fd.vpp.jvpp.snat.dto.SnatInterfaceDetailsReplyDump; -import io.fd.vpp.jvpp.snat.dto.SnatInterfaceDump; -import io.fd.vpp.jvpp.snat.dto.SnatInterfaceOutputFeatureDetailsReplyDump; -import io.fd.vpp.jvpp.snat.dto.SnatInterfaceOutputFeatureDump; -import io.fd.vpp.jvpp.snat.future.FutureJVppSnatFacade; +import io.fd.vpp.jvpp.nat.dto.Nat44InterfaceDetailsReplyDump; +import io.fd.vpp.jvpp.nat.dto.Nat44InterfaceDump; +import io.fd.vpp.jvpp.nat.dto.Nat44InterfaceOutputFeatureDetailsReplyDump; +import io.fd.vpp.jvpp.nat.dto.Nat44InterfaceOutputFeatureDump; +import io.fd.vpp.jvpp.nat.dto.Nat64InterfaceDetailsReplyDump; +import io.fd.vpp.jvpp.nat.dto.Nat64InterfaceDump; +import io.fd.vpp.jvpp.nat.future.FutureJVppNatFacade; import javax.annotation.Nonnull; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.Interface; import org.opendaylight.yangtools.concepts.Builder; @@ -42,36 +42,36 @@ import org.slf4j.Logger; abstract class AbstractInterfaceNatCustomizer<C extends DataObject, B extends Builder<C>> implements InitializingReaderCustomizer<C, B>, JvppReplyConsumer { - private final DumpCacheManager<SnatInterfaceDetailsReplyDump, Void> preRoutingNat44DumpMgr; + private final DumpCacheManager<Nat44InterfaceDetailsReplyDump, Void> preRoutingNat44DumpMgr; private final DumpCacheManager<Nat64InterfaceDetailsReplyDump, Void> preRoutingNat64DumpMgr; - private final DumpCacheManager<SnatInterfaceOutputFeatureDetailsReplyDump, Void> postRoutingNat44DumpMgr; + private final DumpCacheManager<Nat44InterfaceOutputFeatureDetailsReplyDump, Void> postRoutingNat44DumpMgr; private final NamingContext ifcContext; private final VppAttributesBuilder vppAttributesBuilder; - AbstractInterfaceNatCustomizer(@Nonnull final FutureJVppSnatFacade jvppSnat, + AbstractInterfaceNatCustomizer(@Nonnull final FutureJVppNatFacade jvppNat, @Nonnull final NamingContext ifcContext, @Nonnull final VppAttributesBuilder vppAttributesBuilder) { - requireNonNull(jvppSnat, "jvppSnat should not be null"); + requireNonNull(jvppNat, "jvppNat should not be null"); this.ifcContext = requireNonNull(ifcContext, "ifcContext should not be null"); this.vppAttributesBuilder = requireNonNull(vppAttributesBuilder, "ifcContext should not be null"); this.preRoutingNat44DumpMgr = - new DumpCacheManager.DumpCacheManagerBuilder<SnatInterfaceDetailsReplyDump, Void>() + new DumpCacheManager.DumpCacheManagerBuilder<Nat44InterfaceDetailsReplyDump, Void>() .withExecutor((id, params) -> getReplyForRead( - jvppSnat.snatInterfaceDump(new SnatInterfaceDump()).toCompletableFuture(), id)) - .acceptOnly(SnatInterfaceDetailsReplyDump.class) + jvppNat.nat44InterfaceDump(new Nat44InterfaceDump()).toCompletableFuture(), id)) + .acceptOnly(Nat44InterfaceDetailsReplyDump.class) .build(); this.preRoutingNat64DumpMgr = new DumpCacheManager.DumpCacheManagerBuilder<Nat64InterfaceDetailsReplyDump, Void>() .withExecutor((id, params) -> getReplyForRead( - jvppSnat.nat64InterfaceDump(new Nat64InterfaceDump()).toCompletableFuture(), id)) + jvppNat.nat64InterfaceDump(new Nat64InterfaceDump()).toCompletableFuture(), id)) .acceptOnly(Nat64InterfaceDetailsReplyDump.class) .build(); this.postRoutingNat44DumpMgr = - new DumpCacheManager.DumpCacheManagerBuilder<SnatInterfaceOutputFeatureDetailsReplyDump, Void>() + new DumpCacheManager.DumpCacheManagerBuilder<Nat44InterfaceOutputFeatureDetailsReplyDump, Void>() .withExecutor((id, params) -> getReplyForRead( - jvppSnat.snatInterfaceOutputFeatureDump(new SnatInterfaceOutputFeatureDump()) + jvppNat.nat44InterfaceOutputFeatureDump(new Nat44InterfaceOutputFeatureDump()) .toCompletableFuture(), id)) - .acceptOnly(SnatInterfaceOutputFeatureDetailsReplyDump.class) + .acceptOnly(Nat44InterfaceOutputFeatureDetailsReplyDump.class) .build(); } @@ -92,14 +92,14 @@ abstract class AbstractInterfaceNatCustomizer<C extends DataObject, B extends Bu private void readPreRoutingNat44(final InstanceIdentifier<C> id, final int index, final B builder, final ReadContext ctx) throws ReadFailedException { - final Optional<SnatInterfaceDetailsReplyDump> dump = + final Optional<Nat44InterfaceDetailsReplyDump> dump = preRoutingNat44DumpMgr.getDump(id, ctx.getModificationCache(), null); - dump.or(new SnatInterfaceDetailsReplyDump()).snatInterfaceDetails.stream() - .filter(snatIfcDetail -> snatIfcDetail.swIfIndex == index) - .filter(snatIfcDetail -> isExpectedNatType(snatIfcDetail.isInside)) + dump.or(new Nat44InterfaceDetailsReplyDump()).nat44InterfaceDetails.stream() + .filter(natIfcDetail -> natIfcDetail.swIfIndex == index) + .filter(natIfcDetail -> isExpectedNatType(natIfcDetail.isInside)) .findAny() - .ifPresent(snatIfcDetail -> vppAttributesBuilder.enableNat44(builder)); + .ifPresent(natIfcDetail -> vppAttributesBuilder.enableNat44(builder)); // do not modify builder is feature is absent (inbound/outbound are presence containers) } @@ -109,24 +109,24 @@ abstract class AbstractInterfaceNatCustomizer<C extends DataObject, B extends Bu preRoutingNat64DumpMgr.getDump(id, ctx.getModificationCache(), null); dump.or(new Nat64InterfaceDetailsReplyDump()).nat64InterfaceDetails.stream() - .filter(snatIfcDetail -> snatIfcDetail.swIfIndex == index) - .filter(snatIfcDetail -> isExpectedNatType(snatIfcDetail.isInside)) + .filter(natIfcDetail -> natIfcDetail.swIfIndex == index) + .filter(natIfcDetail -> isExpectedNatType(natIfcDetail.isInside)) .findAny() - .ifPresent(snatIfcDetail -> vppAttributesBuilder.enableNat64(builder)); + .ifPresent(natIfcDetail -> vppAttributesBuilder.enableNat64(builder)); // do not modify builder is feature is absent (inbound/outbound are presence containers) } private void readPostRoutingNat44(final InstanceIdentifier<C> id, final int index, final B builder, final ReadContext ctx) throws ReadFailedException { - final Optional<SnatInterfaceOutputFeatureDetailsReplyDump> dump = + final Optional<Nat44InterfaceOutputFeatureDetailsReplyDump> dump = postRoutingNat44DumpMgr.getDump(id, ctx.getModificationCache(), null); - dump.or(new SnatInterfaceOutputFeatureDetailsReplyDump()).snatInterfaceOutputFeatureDetails + dump.or(new Nat44InterfaceOutputFeatureDetailsReplyDump()).nat44InterfaceOutputFeatureDetails .stream() - .filter(snatIfcDetail -> snatIfcDetail.swIfIndex == index) - .filter(snatIfcDetail -> isExpectedNatType(snatIfcDetail.isInside)) + .filter(natIfcDetail -> natIfcDetail.swIfIndex == index) + .filter(natIfcDetail -> isExpectedNatType(natIfcDetail.isInside)) .findAny() - .ifPresent(snatIfcDetail -> vppAttributesBuilder.enablePostRouting(builder)); + .ifPresent(natIfcDetail -> vppAttributesBuilder.enablePostRouting(builder)); // do not modify builder is feature is absent (inbound/outbound are presence containers) } diff --git a/nat/nat2vpp/src/main/java/io/fd/hc2vpp/nat/read/ifc/AbstractSubInterfaceNatCustomizer.java b/nat/nat2vpp/src/main/java/io/fd/hc2vpp/nat/read/ifc/AbstractSubInterfaceNatCustomizer.java index 449d57e7d..6edfbe9ca 100644 --- a/nat/nat2vpp/src/main/java/io/fd/hc2vpp/nat/read/ifc/AbstractSubInterfaceNatCustomizer.java +++ b/nat/nat2vpp/src/main/java/io/fd/hc2vpp/nat/read/ifc/AbstractSubInterfaceNatCustomizer.java @@ -19,7 +19,7 @@ package io.fd.hc2vpp.nat.read.ifc; import static com.google.common.base.Preconditions.checkNotNull; import io.fd.hc2vpp.common.translate.util.NamingContext; -import io.fd.vpp.jvpp.snat.future.FutureJVppSnatFacade; +import io.fd.vpp.jvpp.nat.future.FutureJVppNatFacade; import javax.annotation.Nonnull; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.Interface; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev170607.interfaces.state._interface.sub.interfaces.SubInterface; @@ -29,10 +29,10 @@ import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; abstract class AbstractSubInterfaceNatCustomizer<C extends DataObject, B extends Builder<C>> extends AbstractInterfaceNatCustomizer<C, B> { - AbstractSubInterfaceNatCustomizer(@Nonnull final FutureJVppSnatFacade jvppSnat, + AbstractSubInterfaceNatCustomizer(@Nonnull final FutureJVppNatFacade jvppNat, @Nonnull final NamingContext ifcContext, @Nonnull final VppAttributesBuilder vppAttributesBuilder) { - super(jvppSnat, ifcContext, vppAttributesBuilder); + super(jvppNat, ifcContext, vppAttributesBuilder); } @Override diff --git a/nat/nat2vpp/src/main/java/io/fd/hc2vpp/nat/read/ifc/IfcNatReaderFactory.java b/nat/nat2vpp/src/main/java/io/fd/hc2vpp/nat/read/ifc/IfcNatReaderFactory.java index 86dc605ce..c86bbef8f 100644 --- a/nat/nat2vpp/src/main/java/io/fd/hc2vpp/nat/read/ifc/IfcNatReaderFactory.java +++ b/nat/nat2vpp/src/main/java/io/fd/hc2vpp/nat/read/ifc/IfcNatReaderFactory.java @@ -22,7 +22,7 @@ import io.fd.hc2vpp.common.translate.util.NamingContext; import io.fd.honeycomb.translate.impl.read.GenericInitReader; import io.fd.honeycomb.translate.read.ReaderFactory; import io.fd.honeycomb.translate.read.registry.ModifiableReaderRegistryBuilder; -import io.fd.vpp.jvpp.snat.future.FutureJVppSnatFacade; +import io.fd.vpp.jvpp.nat.future.FutureJVppNatFacade; import javax.annotation.Nonnull; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.InterfacesState; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.Interface; @@ -45,12 +45,12 @@ public final class IfcNatReaderFactory implements ReaderFactory { IFC_ID.augmentation(NatInterfaceStateAugmentation.class); private static final InstanceIdentifier<Nat> NAT_AUG_CONTAINER_ID = NAT_AUG_ID.child(Nat.class); private final NamingContext ifcContext; - private final FutureJVppSnatFacade jvppSnat; + private final FutureJVppNatFacade jvppNat; @Inject - public IfcNatReaderFactory(final FutureJVppSnatFacade jvppSnat, + public IfcNatReaderFactory(final FutureJVppNatFacade jvppNat, @Named("interface-context") final NamingContext ifcContext) { - this.jvppSnat = jvppSnat; + this.jvppNat = jvppNat; this.ifcContext = ifcContext; } @@ -60,8 +60,8 @@ public final class IfcNatReaderFactory implements ReaderFactory { registry.addStructuralReader(NAT_AUG_CONTAINER_ID, NatBuilder.class); registry.addAfter(new GenericInitReader<>(NAT_AUG_CONTAINER_ID.child(Inbound.class), - new InterfaceInboundNatCustomizer(jvppSnat, ifcContext)), IFC_ID); + new InterfaceInboundNatCustomizer(jvppNat, ifcContext)), IFC_ID); registry.addAfter(new GenericInitReader<>(NAT_AUG_CONTAINER_ID.child(Outbound.class), - new InterfaceOutboundNatCustomizer(jvppSnat, ifcContext)), IFC_ID); + new InterfaceOutboundNatCustomizer(jvppNat, ifcContext)), IFC_ID); } } diff --git a/nat/nat2vpp/src/main/java/io/fd/hc2vpp/nat/read/ifc/InterfaceInboundNatCustomizer.java b/nat/nat2vpp/src/main/java/io/fd/hc2vpp/nat/read/ifc/InterfaceInboundNatCustomizer.java index cabdd0f8b..269ddd229 100644 --- a/nat/nat2vpp/src/main/java/io/fd/hc2vpp/nat/read/ifc/InterfaceInboundNatCustomizer.java +++ b/nat/nat2vpp/src/main/java/io/fd/hc2vpp/nat/read/ifc/InterfaceInboundNatCustomizer.java @@ -19,7 +19,7 @@ package io.fd.hc2vpp.nat.read.ifc; import io.fd.hc2vpp.common.translate.util.NamingContext; import io.fd.honeycomb.translate.read.ReadContext; import io.fd.honeycomb.translate.spi.read.Initialized; -import io.fd.vpp.jvpp.snat.future.FutureJVppSnatFacade; +import io.fd.vpp.jvpp.nat.future.FutureJVppNatFacade; 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; @@ -39,9 +39,9 @@ final class InterfaceInboundNatCustomizer extends AbstractInterfaceNatCustomizer private static final Logger LOG = LoggerFactory.getLogger(InterfaceInboundNatCustomizer.class); - InterfaceInboundNatCustomizer(@Nonnull final FutureJVppSnatFacade jvppSnat, + InterfaceInboundNatCustomizer(@Nonnull final FutureJVppNatFacade jvppNat, @Nonnull final NamingContext ifcContext) { - super(jvppSnat, ifcContext, new InboundAttributesBuilder()); + super(jvppNat, ifcContext, new InboundAttributesBuilder()); } @Override diff --git a/nat/nat2vpp/src/main/java/io/fd/hc2vpp/nat/read/ifc/InterfaceOutboundNatCustomizer.java b/nat/nat2vpp/src/main/java/io/fd/hc2vpp/nat/read/ifc/InterfaceOutboundNatCustomizer.java index 438e43862..5b601e87c 100644 --- a/nat/nat2vpp/src/main/java/io/fd/hc2vpp/nat/read/ifc/InterfaceOutboundNatCustomizer.java +++ b/nat/nat2vpp/src/main/java/io/fd/hc2vpp/nat/read/ifc/InterfaceOutboundNatCustomizer.java @@ -19,7 +19,7 @@ package io.fd.hc2vpp.nat.read.ifc; import io.fd.hc2vpp.common.translate.util.NamingContext; import io.fd.honeycomb.translate.read.ReadContext; import io.fd.honeycomb.translate.spi.read.Initialized; -import io.fd.vpp.jvpp.snat.future.FutureJVppSnatFacade; +import io.fd.vpp.jvpp.nat.future.FutureJVppNatFacade; 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; @@ -39,9 +39,9 @@ final class InterfaceOutboundNatCustomizer extends AbstractInterfaceNatCustomize private static final Logger LOG = LoggerFactory.getLogger(InterfaceOutboundNatCustomizer.class); - InterfaceOutboundNatCustomizer(@Nonnull final FutureJVppSnatFacade jvppSnat, + InterfaceOutboundNatCustomizer(@Nonnull final FutureJVppNatFacade jvppNat, @Nonnull final NamingContext ifcContext) { - super(jvppSnat, ifcContext, new OutboundAttributesReader()); + super(jvppNat, ifcContext, new OutboundAttributesReader()); } @Override diff --git a/nat/nat2vpp/src/main/java/io/fd/hc2vpp/nat/read/ifc/SubIfcNatReaderFactory.java b/nat/nat2vpp/src/main/java/io/fd/hc2vpp/nat/read/ifc/SubIfcNatReaderFactory.java index 18a81639b..b431f512b 100644 --- a/nat/nat2vpp/src/main/java/io/fd/hc2vpp/nat/read/ifc/SubIfcNatReaderFactory.java +++ b/nat/nat2vpp/src/main/java/io/fd/hc2vpp/nat/read/ifc/SubIfcNatReaderFactory.java @@ -23,7 +23,7 @@ import io.fd.hc2vpp.common.translate.util.NamingContext; import io.fd.honeycomb.translate.impl.read.GenericInitReader; import io.fd.honeycomb.translate.read.ReaderFactory; import io.fd.honeycomb.translate.read.registry.ModifiableReaderRegistryBuilder; -import io.fd.vpp.jvpp.snat.future.FutureJVppSnatFacade; +import io.fd.vpp.jvpp.nat.future.FutureJVppNatFacade; import javax.annotation.Nonnull; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.InterfacesState; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.Interface; @@ -51,12 +51,12 @@ public final class SubIfcNatReaderFactory implements ReaderFactory { private static final InstanceIdentifier<Nat> NAT_AUG_CONTAINER_ID = NAT_SUB_AUG_ID.child(Nat.class); private final NamingContext ifcContext; - private final FutureJVppSnatFacade jvppSnat; + private final FutureJVppNatFacade jvppNat; @Inject - public SubIfcNatReaderFactory(final FutureJVppSnatFacade jvppSnat, + public SubIfcNatReaderFactory(final FutureJVppNatFacade jvppNat, @Named("interface-context") final NamingContext ifcContext) { - this.jvppSnat = jvppSnat; + this.jvppNat = jvppNat; this.ifcContext = ifcContext; } @@ -66,8 +66,8 @@ public final class SubIfcNatReaderFactory implements ReaderFactory { registry.addStructuralReader(NAT_AUG_CONTAINER_ID, NatBuilder.class); registry.addAfter(new GenericInitReader<>(NAT_AUG_CONTAINER_ID.child(Inbound.class), - new SubInterfaceInboundNatCustomizer(jvppSnat, ifcContext)), SUB_IFC_ID); + new SubInterfaceInboundNatCustomizer(jvppNat, ifcContext)), SUB_IFC_ID); registry.addAfter(new GenericInitReader<>(NAT_AUG_CONTAINER_ID.child(Outbound.class), - new SubInterfaceOutboundNatCustomizer(jvppSnat, ifcContext)), SUB_IFC_ID); + new SubInterfaceOutboundNatCustomizer(jvppNat, ifcContext)), SUB_IFC_ID); } } diff --git a/nat/nat2vpp/src/main/java/io/fd/hc2vpp/nat/read/ifc/SubInterfaceInboundNatCustomizer.java b/nat/nat2vpp/src/main/java/io/fd/hc2vpp/nat/read/ifc/SubInterfaceInboundNatCustomizer.java index 39ee7c9f3..49d0301be 100644 --- a/nat/nat2vpp/src/main/java/io/fd/hc2vpp/nat/read/ifc/SubInterfaceInboundNatCustomizer.java +++ b/nat/nat2vpp/src/main/java/io/fd/hc2vpp/nat/read/ifc/SubInterfaceInboundNatCustomizer.java @@ -19,7 +19,7 @@ package io.fd.hc2vpp.nat.read.ifc; import io.fd.hc2vpp.common.translate.util.NamingContext; import io.fd.honeycomb.translate.read.ReadContext; import io.fd.honeycomb.translate.spi.read.Initialized; -import io.fd.vpp.jvpp.snat.future.FutureJVppSnatFacade; +import io.fd.vpp.jvpp.nat.future.FutureJVppNatFacade; 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; @@ -43,9 +43,9 @@ final class SubInterfaceInboundNatCustomizer extends AbstractSubInterfaceNatCust private static final Logger LOG = LoggerFactory.getLogger(SubInterfaceInboundNatCustomizer.class); - SubInterfaceInboundNatCustomizer(@Nonnull final FutureJVppSnatFacade jvppSnat, + SubInterfaceInboundNatCustomizer(@Nonnull final FutureJVppNatFacade jvppNat, @Nonnull final NamingContext ifcContext) { - super(jvppSnat, ifcContext, new InboundAttributesBuilder()); + super(jvppNat, ifcContext, new InboundAttributesBuilder()); } @Override diff --git a/nat/nat2vpp/src/main/java/io/fd/hc2vpp/nat/read/ifc/SubInterfaceOutboundNatCustomizer.java b/nat/nat2vpp/src/main/java/io/fd/hc2vpp/nat/read/ifc/SubInterfaceOutboundNatCustomizer.java index 330e4c4b3..4fe472f3d 100644 --- a/nat/nat2vpp/src/main/java/io/fd/hc2vpp/nat/read/ifc/SubInterfaceOutboundNatCustomizer.java +++ b/nat/nat2vpp/src/main/java/io/fd/hc2vpp/nat/read/ifc/SubInterfaceOutboundNatCustomizer.java @@ -19,7 +19,7 @@ package io.fd.hc2vpp.nat.read.ifc; import io.fd.hc2vpp.common.translate.util.NamingContext; import io.fd.honeycomb.translate.read.ReadContext; import io.fd.honeycomb.translate.spi.read.Initialized; -import io.fd.vpp.jvpp.snat.future.FutureJVppSnatFacade; +import io.fd.vpp.jvpp.nat.future.FutureJVppNatFacade; 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; @@ -43,9 +43,9 @@ final class SubInterfaceOutboundNatCustomizer extends AbstractSubInterfaceNatCus private static final Logger LOG = LoggerFactory.getLogger(SubInterfaceOutboundNatCustomizer.class); - SubInterfaceOutboundNatCustomizer(@Nonnull final FutureJVppSnatFacade jvppSnat, + SubInterfaceOutboundNatCustomizer(@Nonnull final FutureJVppNatFacade jvppNat, @Nonnull final NamingContext ifcContext) { - super(jvppSnat, ifcContext, new OutboundAttributesReader()); + super(jvppNat, ifcContext, new OutboundAttributesReader()); } @Override diff --git a/nat/nat2vpp/src/main/java/io/fd/hc2vpp/nat/util/MappingEntryContext.java b/nat/nat2vpp/src/main/java/io/fd/hc2vpp/nat/util/MappingEntryContext.java index 292adc3aa..0f3924ec6 100644 --- a/nat/nat2vpp/src/main/java/io/fd/hc2vpp/nat/util/MappingEntryContext.java +++ b/nat/nat2vpp/src/main/java/io/fd/hc2vpp/nat/util/MappingEntryContext.java @@ -23,8 +23,8 @@ import com.google.common.base.Optional; import io.fd.hc2vpp.common.translate.util.Ipv4Translator; import io.fd.hc2vpp.common.translate.util.Ipv6Translator; import io.fd.honeycomb.translate.MappingContext; -import io.fd.vpp.jvpp.snat.dto.Nat64BibDetails; -import io.fd.vpp.jvpp.snat.dto.SnatStaticMappingDetails; +import io.fd.vpp.jvpp.nat.dto.Nat44StaticMappingDetails; +import io.fd.vpp.jvpp.nat.dto.Nat64BibDetails; import java.util.Collections; import java.util.Comparator; import java.util.List; @@ -97,7 +97,7 @@ public class MappingEntryContext implements Ipv4Translator, Ipv6Translator { return new MappingEntryKey(new IpAddress(entry.getExternalSrcAddress()), entry.getInternalSrcAddress()); } - private MappingEntryKey entryToKey(final SnatStaticMappingDetails entry) { + private MappingEntryKey entryToKey(final Nat44StaticMappingDetails entry) { // Only IPv4 return new MappingEntryKey( new IpAddress(new Ipv4Address(arrayToIpv4AddressNoZone(entry.externalIpAddress))), @@ -110,7 +110,7 @@ public class MappingEntryContext implements Ipv4Translator, Ipv6Translator { new IpAddress(new Ipv6Address(arrayToIpv6AddressNoZone(entry.iAddr)))); } - private boolean equalEntries(final SnatStaticMappingDetails detail, final MappingEntry ctxMappingEntry) { + private boolean equalEntries(final Nat44StaticMappingDetails detail, final MappingEntry ctxMappingEntry) { final IpAddress internalAddrFromDetails = new IpAddress(new Ipv4Address(arrayToIpv4AddressNoZone(detail.localIpAddress))); // Only IPv4 @@ -152,7 +152,7 @@ public class MappingEntryContext implements Ipv4Translator, Ipv6Translator { .build(); } - private MappingEntry toCtxMapEntry(@Nonnull final SnatStaticMappingDetails details, final long entryId) { + private MappingEntry toCtxMapEntry(@Nonnull final Nat44StaticMappingDetails details, final long entryId) { return new MappingEntryBuilder() .setKey(entryToKey(details)) .setIndex(entryId) @@ -178,9 +178,9 @@ public class MappingEntryContext implements Ipv4Translator, Ipv6Translator { /** * Find specific details in provided collection identified with provided index. */ - public synchronized java.util.Optional<SnatStaticMappingDetails> findDetailsNat44(@Nonnull final List<SnatStaticMappingDetails> details, - final long natInstanceId, final long idx, - @Nonnull final MappingContext mappingContext) { + public synchronized java.util.Optional<Nat44StaticMappingDetails> findDetailsNat44(@Nonnull final List<Nat44StaticMappingDetails> details, + final long natInstanceId, final long idx, + @Nonnull final MappingContext mappingContext) { // Find mapping entry for Index final MappingEntry ctxMappingEntry = mappingContext.read(getTableId(natInstanceId)) .transform(MappingTable::getMappingEntry) @@ -223,7 +223,7 @@ public class MappingEntryContext implements Ipv4Translator, Ipv6Translator { * Get index for a mapping entry details or create an artificial one. */ public synchronized long getStoredOrArtificialIndex(final Long natInstanceId, - @Nonnull final SnatStaticMappingDetails details, + @Nonnull final Nat44StaticMappingDetails details, @Nonnull final MappingContext mappingContext) { return mappingContext.read(getId(natInstanceId, entryToKey(details))) .transform(MappingEntry::getIndex) @@ -251,7 +251,7 @@ public class MappingEntryContext implements Ipv4Translator, Ipv6Translator { .transform(MappingEntry::getIndex); } - private long getArtificialId(final SnatStaticMappingDetails details, final Long natInstanceId, + private long getArtificialId(final Nat44StaticMappingDetails details, final Long natInstanceId, final MappingContext mappingContext) { LOG.trace("Assigning artificial ID for {}", details); final long artificialIdx = findFreeIndex(natInstanceId, mappingContext); diff --git a/nat/nat2vpp/src/main/java/io/fd/hc2vpp/nat/write/ExternalIpPoolCustomizer.java b/nat/nat2vpp/src/main/java/io/fd/hc2vpp/nat/write/ExternalIpPoolCustomizer.java index 62331620d..775c9a6dd 100644 --- a/nat/nat2vpp/src/main/java/io/fd/hc2vpp/nat/write/ExternalIpPoolCustomizer.java +++ b/nat/nat2vpp/src/main/java/io/fd/hc2vpp/nat/write/ExternalIpPoolCustomizer.java @@ -26,9 +26,9 @@ import io.fd.hc2vpp.common.translate.util.JvppReplyConsumer; 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.snat.dto.Nat64AddDelPoolAddrRange; -import io.fd.vpp.jvpp.snat.dto.SnatAddAddressRange; -import io.fd.vpp.jvpp.snat.future.FutureJVppSnatFacade; +import io.fd.vpp.jvpp.nat.dto.Nat44AddDelAddressRange; +import io.fd.vpp.jvpp.nat.dto.Nat64AddDelPoolAddrRange; +import io.fd.vpp.jvpp.nat.future.FutureJVppNatFacade; import javax.annotation.Nonnull; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Prefix; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.nat.rev150908.nat.config.nat.instances.NatInstance; @@ -44,10 +44,10 @@ final class ExternalIpPoolCustomizer implements ListWriterCustomizer<ExternalIpA private static final Logger LOG = LoggerFactory.getLogger(ExternalIpPoolCustomizer.class); - private final FutureJVppSnatFacade jvppSnat; + private final FutureJVppNatFacade jvppNat; - ExternalIpPoolCustomizer(@Nonnull final FutureJVppSnatFacade jvppSnat) { - this.jvppSnat = jvppSnat; + ExternalIpPoolCustomizer(@Nonnull final FutureJVppNatFacade jvppNat) { + this.jvppNat = jvppNat; } @Override @@ -82,18 +82,17 @@ final class ExternalIpPoolCustomizer implements ListWriterCustomizer<ExternalIpA } if (isNat64) { final Nat64AddDelPoolAddrRange request = getNat64Request(addressPool.getExternalIpPool(), isAdd); - getReplyForWrite(jvppSnat.nat64AddDelPoolAddrRange(request).toCompletableFuture(), id); + getReplyForWrite(jvppNat.nat64AddDelPoolAddrRange(request).toCompletableFuture(), id); } else { - final SnatAddAddressRange request = getNat44Request(addressPool.getExternalIpPool(), isAdd); - getReplyForWrite(jvppSnat.snatAddAddressRange(request).toCompletableFuture(), id); + final Nat44AddDelAddressRange request = getNat44Request(addressPool.getExternalIpPool(), isAdd); + getReplyForWrite(jvppNat.nat44AddDelAddressRange(request).toCompletableFuture(), id); } } - private SnatAddAddressRange getNat44Request(final Ipv4Prefix externalIpPool, boolean isAdd) { - final SnatAddAddressRange request = new SnatAddAddressRange(); + private Nat44AddDelAddressRange getNat44Request(final Ipv4Prefix externalIpPool, boolean isAdd) { + final Nat44AddDelAddressRange request = new Nat44AddDelAddressRange(); final Ipv4AddressRange range = Ipv4AddressRange.fromPrefix(externalIpPool); LOG.trace("Handling NAT44 address range: {}", range); - request.isIp4 = 1; request.isAdd = booleanToByte(isAdd); request.firstIpAddress = ipv4AddressNoZoneToArray(range.getStart()); request.lastIpAddress = ipv4AddressNoZoneToArray(range.getEnd()); diff --git a/nat/nat2vpp/src/main/java/io/fd/hc2vpp/nat/write/MappingEntryCustomizer.java b/nat/nat2vpp/src/main/java/io/fd/hc2vpp/nat/write/MappingEntryCustomizer.java index 35ed9e2d8..97a41c0ca 100644 --- a/nat/nat2vpp/src/main/java/io/fd/hc2vpp/nat/write/MappingEntryCustomizer.java +++ b/nat/nat2vpp/src/main/java/io/fd/hc2vpp/nat/write/MappingEntryCustomizer.java @@ -28,9 +28,9 @@ import io.fd.hc2vpp.nat.util.MappingEntryContext; 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.snat.dto.Nat64AddDelStaticBib; -import io.fd.vpp.jvpp.snat.dto.SnatAddStaticMapping; -import io.fd.vpp.jvpp.snat.future.FutureJVppSnatFacade; +import io.fd.vpp.jvpp.nat.dto.Nat44AddDelStaticMapping; +import io.fd.vpp.jvpp.nat.dto.Nat64AddDelStaticBib; +import io.fd.vpp.jvpp.nat.future.FutureJVppNatFacade; 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.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Address; @@ -50,11 +50,11 @@ final class MappingEntryCustomizer implements ListWriterCustomizer<MappingEntry, private static final Logger LOG = LoggerFactory.getLogger(MappingEntryCustomizer.class); - private final FutureJVppSnatFacade jvppSnat; + private final FutureJVppNatFacade jvppNat; private final MappingEntryContext mappingEntryContext; - MappingEntryCustomizer(final FutureJVppSnatFacade jvppSnat, final MappingEntryContext mappingEntryContext) { - this.jvppSnat = jvppSnat; + MappingEntryCustomizer(final FutureJVppNatFacade jvppNat, final MappingEntryContext mappingEntryContext) { + this.jvppNat = jvppNat; this.mappingEntryContext = mappingEntryContext; } @@ -91,13 +91,13 @@ final class MappingEntryCustomizer implements ListWriterCustomizer<MappingEntry, final Ipv4Address internalV4SrcAddress = internalSrcAddress.getIpv4Address(); final Ipv6Address internalV6SrcAddress = internalSrcAddress.getIpv6Address(); if (internalV4SrcAddress != null) { - final SnatAddStaticMapping request = getNat44Request(id, entry, natInstanceId, isAdd); - getReplyForWrite(jvppSnat.snatAddStaticMapping(request).toCompletableFuture(), id); + final Nat44AddDelStaticMapping request = getNat44Request(id, entry, natInstanceId, isAdd); + getReplyForWrite(jvppNat.nat44AddDelStaticMapping(request).toCompletableFuture(), id); } else { checkState(internalV6SrcAddress != null, "internalSrcAddress.getIpv6Address() should not return null if v4 address is not given"); final Nat64AddDelStaticBib request = getNat64Request(id, entry, natInstanceId, isAdd); - getReplyForWrite(jvppSnat.nat64AddDelStaticBib(request).toCompletableFuture(), id); + getReplyForWrite(jvppNat.nat64AddDelStaticBib(request).toCompletableFuture(), id); } } @@ -139,14 +139,13 @@ final class MappingEntryCustomizer implements ListWriterCustomizer<MappingEntry, LOG.trace("Mapping entry: {} for nat-instance(vrf): {} deleted successfully", natInstanceId, id); } - private SnatAddStaticMapping getNat44Request(final InstanceIdentifier<MappingEntry> id, + private Nat44AddDelStaticMapping getNat44Request(final InstanceIdentifier<MappingEntry> id, final MappingEntry mappingEntry, final Long natInstanceId, final boolean isAdd) throws WriteFailedException.CreateFailedException { - final SnatAddStaticMapping request = new SnatAddStaticMapping(); + final Nat44AddDelStaticMapping request = new Nat44AddDelStaticMapping(); request.isAdd = booleanToByte(isAdd); - request.isIp4 = 1; // VPP uses int, model long request.vrfId = natInstanceId.intValue(); diff --git a/nat/nat2vpp/src/main/java/io/fd/hc2vpp/nat/write/NatWriterFactory.java b/nat/nat2vpp/src/main/java/io/fd/hc2vpp/nat/write/NatWriterFactory.java index ef2a2afdd..e315da637 100644 --- a/nat/nat2vpp/src/main/java/io/fd/hc2vpp/nat/write/NatWriterFactory.java +++ b/nat/nat2vpp/src/main/java/io/fd/hc2vpp/nat/write/NatWriterFactory.java @@ -22,7 +22,7 @@ import io.fd.hc2vpp.nat.util.MappingEntryContext; import io.fd.honeycomb.translate.impl.write.GenericListWriter; import io.fd.honeycomb.translate.write.WriterFactory; import io.fd.honeycomb.translate.write.registry.ModifiableWriterRegistryBuilder; -import io.fd.vpp.jvpp.snat.future.FutureJVppSnatFacade; +import io.fd.vpp.jvpp.nat.future.FutureJVppNatFacade; import javax.annotation.Nonnull; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.nat.rev150908.NatConfig; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.nat.rev150908.mapping.entry.ExternalSrcPort; @@ -46,13 +46,13 @@ public final class NatWriterFactory implements WriterFactory { private static final InstanceIdentifier<MappingEntry> MAP_ENTRY_ID = NAT_INSTANCE_ID.child(MappingTable.class).child(MappingEntry.class); - private final FutureJVppSnatFacade jvppSnat; + private final FutureJVppNatFacade jvppNat; private final MappingEntryContext mappingEntryContext; @Inject - public NatWriterFactory(final FutureJVppSnatFacade jvppSnat, + public NatWriterFactory(final FutureJVppNatFacade jvppNat, final MappingEntryContext mappingEntryContext) { - this.jvppSnat = jvppSnat; + this.jvppNat = jvppNat; this.mappingEntryContext = mappingEntryContext; } @@ -63,7 +63,7 @@ public final class NatWriterFactory implements WriterFactory { // Mapping-entry registry.subtreeAdd(Sets.newHashSet(InstanceIdentifier.create(MappingEntry.class).child(ExternalSrcPort.class), InstanceIdentifier.create(MappingEntry.class).child(InternalSrcPort.class)), - new GenericListWriter<>(MAP_ENTRY_ID, new MappingEntryCustomizer(jvppSnat, mappingEntryContext))); + new GenericListWriter<>(MAP_ENTRY_ID, new MappingEntryCustomizer(jvppNat, mappingEntryContext))); // External address pool has to be executed before mapping entry. Because adding mapping entries requires to // already have an IP range predefined ... in some cases @@ -71,7 +71,7 @@ public final class NatWriterFactory implements WriterFactory { Sets.newHashSet(InstanceIdentifier.create(ExternalIpAddressPool.class) .augmentation(ExternalIpAddressPoolConfigAugmentation.class)), new GenericListWriter<>(NAT_INSTANCE_ID.child(ExternalIpAddressPool.class), - new ExternalIpPoolCustomizer(jvppSnat)), + new ExternalIpPoolCustomizer(jvppNat)), MAP_ENTRY_ID); } } diff --git a/nat/nat2vpp/src/main/java/io/fd/hc2vpp/nat/write/ifc/AbstractInterfaceNatCustomizer.java b/nat/nat2vpp/src/main/java/io/fd/hc2vpp/nat/write/ifc/AbstractInterfaceNatCustomizer.java index 4a44fe9a6..28128bec5 100644 --- a/nat/nat2vpp/src/main/java/io/fd/hc2vpp/nat/write/ifc/AbstractInterfaceNatCustomizer.java +++ b/nat/nat2vpp/src/main/java/io/fd/hc2vpp/nat/write/ifc/AbstractInterfaceNatCustomizer.java @@ -24,10 +24,10 @@ import io.fd.hc2vpp.common.translate.util.NamingContext; import io.fd.honeycomb.translate.spi.write.WriterCustomizer; import io.fd.honeycomb.translate.write.WriteContext; import io.fd.honeycomb.translate.write.WriteFailedException; -import io.fd.vpp.jvpp.snat.dto.Nat64AddDelInterface; -import io.fd.vpp.jvpp.snat.dto.SnatInterfaceAddDelFeature; -import io.fd.vpp.jvpp.snat.dto.SnatInterfaceAddDelOutputFeature; -import io.fd.vpp.jvpp.snat.future.FutureJVppSnatFacade; +import io.fd.vpp.jvpp.nat.dto.Nat44InterfaceAddDelFeature; +import io.fd.vpp.jvpp.nat.dto.Nat44InterfaceAddDelOutputFeature; +import io.fd.vpp.jvpp.nat.dto.Nat64AddDelInterface; +import io.fd.vpp.jvpp.nat.future.FutureJVppNatFacade; 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.opendaylight.params.xml.ns.yang._interface.nat.rev170816.InterfaceNatVppFeatureAttributes; @@ -38,12 +38,12 @@ import org.slf4j.Logger; abstract class AbstractInterfaceNatCustomizer<D extends InterfaceNatVppFeatureAttributes & DataObject> implements ByteDataTranslator, JvppReplyConsumer, WriterCustomizer<D> { - private final FutureJVppSnatFacade jvppSnat; + private final FutureJVppNatFacade jvppNat; private final NamingContext ifcContext; - AbstractInterfaceNatCustomizer(@Nonnull final FutureJVppSnatFacade jvppSnat, + AbstractInterfaceNatCustomizer(@Nonnull final FutureJVppNatFacade jvppNat, @Nonnull final NamingContext ifcContext) { - this.jvppSnat = jvppSnat; + this.jvppNat = jvppNat; this.ifcContext = ifcContext; } @@ -88,11 +88,11 @@ abstract class AbstractInterfaceNatCustomizer<D extends InterfaceNatVppFeatureAt final boolean enable) throws WriteFailedException { checkArgument(!isNat64Supported(natAttributes), "Post routing Nat64 is not supported by VPP"); - final SnatInterfaceAddDelOutputFeature request = new SnatInterfaceAddDelOutputFeature(); + final Nat44InterfaceAddDelOutputFeature request = new Nat44InterfaceAddDelOutputFeature(); request.isAdd = booleanToByte(enable); request.isInside = getType().isInside; request.swIfIndex = ifcIndex; - getReplyForWrite(jvppSnat.snatInterfaceAddDelOutputFeature(request).toCompletableFuture(), id); + getReplyForWrite(jvppNat.nat44InterfaceAddDelOutputFeature(request).toCompletableFuture(), id); } private void preRoutingNat(@Nonnull final InstanceIdentifier<D> id, final D natAttributes, final int ifcIndex, @@ -113,11 +113,11 @@ abstract class AbstractInterfaceNatCustomizer<D extends InterfaceNatVppFeatureAt private void preRoutingNat44(@Nonnull final InstanceIdentifier<D> id, final int ifcIndex, final boolean enable) throws WriteFailedException { - final SnatInterfaceAddDelFeature request = new SnatInterfaceAddDelFeature(); + final Nat44InterfaceAddDelFeature request = new Nat44InterfaceAddDelFeature(); request.isAdd = booleanToByte(enable); request.isInside = getType().isInside; request.swIfIndex = ifcIndex; - getReplyForWrite(jvppSnat.snatInterfaceAddDelFeature(request).toCompletableFuture(), id); + getReplyForWrite(jvppNat.nat44InterfaceAddDelFeature(request).toCompletableFuture(), id); } private void preRoutingNat64(@Nonnull final InstanceIdentifier<D> id, final int ifcIndex, final boolean enable) @@ -126,7 +126,7 @@ abstract class AbstractInterfaceNatCustomizer<D extends InterfaceNatVppFeatureAt request.isAdd = booleanToByte(enable); request.isInside = getType().isInside; request.swIfIndex = ifcIndex; - getReplyForWrite(jvppSnat.nat64AddDelInterface(request).toCompletableFuture(), id); + getReplyForWrite(jvppNat.nat64AddDelInterface(request).toCompletableFuture(), id); } enum NatType { diff --git a/nat/nat2vpp/src/main/java/io/fd/hc2vpp/nat/write/ifc/AbstractSubInterfaceNatCustomizer.java b/nat/nat2vpp/src/main/java/io/fd/hc2vpp/nat/write/ifc/AbstractSubInterfaceNatCustomizer.java index a1c4fa522..6ed6c01a4 100644 --- a/nat/nat2vpp/src/main/java/io/fd/hc2vpp/nat/write/ifc/AbstractSubInterfaceNatCustomizer.java +++ b/nat/nat2vpp/src/main/java/io/fd/hc2vpp/nat/write/ifc/AbstractSubInterfaceNatCustomizer.java @@ -34,7 +34,7 @@ package io.fd.hc2vpp.nat.write.ifc; import static com.google.common.base.Preconditions.checkNotNull; import io.fd.hc2vpp.common.translate.util.NamingContext; -import io.fd.vpp.jvpp.snat.future.FutureJVppSnatFacade; +import io.fd.vpp.jvpp.nat.future.FutureJVppNatFacade; 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.opendaylight.params.xml.ns.yang._interface.nat.rev170816.InterfaceNatVppFeatureAttributes; @@ -44,9 +44,9 @@ import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; abstract class AbstractSubInterfaceNatCustomizer<D extends InterfaceNatVppFeatureAttributes & DataObject> extends AbstractInterfaceNatCustomizer<D> { - AbstractSubInterfaceNatCustomizer(@Nonnull final FutureJVppSnatFacade jvppSnat, + AbstractSubInterfaceNatCustomizer(@Nonnull final FutureJVppNatFacade jvppNat, @Nonnull final NamingContext ifcContext) { - super(jvppSnat, ifcContext); + super(jvppNat, ifcContext); } @Override diff --git a/nat/nat2vpp/src/main/java/io/fd/hc2vpp/nat/write/ifc/IfcNatWriterFactory.java b/nat/nat2vpp/src/main/java/io/fd/hc2vpp/nat/write/ifc/IfcNatWriterFactory.java index 008f2f561..baaf98ced 100644 --- a/nat/nat2vpp/src/main/java/io/fd/hc2vpp/nat/write/ifc/IfcNatWriterFactory.java +++ b/nat/nat2vpp/src/main/java/io/fd/hc2vpp/nat/write/ifc/IfcNatWriterFactory.java @@ -22,7 +22,7 @@ import io.fd.hc2vpp.common.translate.util.NamingContext; import io.fd.honeycomb.translate.impl.write.GenericWriter; import io.fd.honeycomb.translate.write.WriterFactory; import io.fd.honeycomb.translate.write.registry.ModifiableWriterRegistryBuilder; -import io.fd.vpp.jvpp.snat.future.FutureJVppSnatFacade; +import io.fd.vpp.jvpp.nat.future.FutureJVppNatFacade; 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; @@ -42,21 +42,21 @@ public final class IfcNatWriterFactory implements WriterFactory { private static final InstanceIdentifier<Nat> NAT_AUG_ID = IFC_ID.augmentation(NatInterfaceAugmentation.class).child(Nat.class); - private final FutureJVppSnatFacade jvppSnat; + private final FutureJVppNatFacade jvppNat; private final NamingContext ifcContext; @Inject - public IfcNatWriterFactory(final FutureJVppSnatFacade jvppSnat, + public IfcNatWriterFactory(final FutureJVppNatFacade jvppNat, @Named("interface-context") final NamingContext ifcContext) { - this.jvppSnat = jvppSnat; + this.jvppNat = jvppNat; this.ifcContext = ifcContext; } @Override public void init(@Nonnull final ModifiableWriterRegistryBuilder registry) { registry.addAfter(new GenericWriter<>(NAT_AUG_ID.child(Inbound.class), - new InterfaceInboundNatCustomizer(jvppSnat, ifcContext)), IFC_ID); + new InterfaceInboundNatCustomizer(jvppNat, ifcContext)), IFC_ID); registry.addAfter(new GenericWriter<>(NAT_AUG_ID.child(Outbound.class), - new InterfaceOutboundNatCustomizer(jvppSnat, ifcContext)), IFC_ID); + new InterfaceOutboundNatCustomizer(jvppNat, ifcContext)), IFC_ID); } } diff --git a/nat/nat2vpp/src/main/java/io/fd/hc2vpp/nat/write/ifc/InterfaceInboundNatCustomizer.java b/nat/nat2vpp/src/main/java/io/fd/hc2vpp/nat/write/ifc/InterfaceInboundNatCustomizer.java index f457e033a..28f3b77d2 100644 --- a/nat/nat2vpp/src/main/java/io/fd/hc2vpp/nat/write/ifc/InterfaceInboundNatCustomizer.java +++ b/nat/nat2vpp/src/main/java/io/fd/hc2vpp/nat/write/ifc/InterfaceInboundNatCustomizer.java @@ -17,7 +17,7 @@ package io.fd.hc2vpp.nat.write.ifc; import io.fd.hc2vpp.common.translate.util.NamingContext; -import io.fd.vpp.jvpp.snat.future.FutureJVppSnatFacade; +import io.fd.vpp.jvpp.nat.future.FutureJVppNatFacade; import javax.annotation.Nonnull; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang._interface.nat.rev170816._interface.nat.attributes.nat.Inbound; import org.slf4j.Logger; @@ -27,9 +27,9 @@ final class InterfaceInboundNatCustomizer extends AbstractInterfaceNatCustomizer private static final Logger LOG = LoggerFactory.getLogger(InterfaceInboundNatCustomizer.class); - InterfaceInboundNatCustomizer(@Nonnull final FutureJVppSnatFacade jvppSnat, + InterfaceInboundNatCustomizer(@Nonnull final FutureJVppNatFacade jvppNat, @Nonnull final NamingContext ifcContext) { - super(jvppSnat, ifcContext); + super(jvppNat, ifcContext); } @Override diff --git a/nat/nat2vpp/src/main/java/io/fd/hc2vpp/nat/write/ifc/InterfaceOutboundNatCustomizer.java b/nat/nat2vpp/src/main/java/io/fd/hc2vpp/nat/write/ifc/InterfaceOutboundNatCustomizer.java index 429278be5..e4d0de2c4 100644 --- a/nat/nat2vpp/src/main/java/io/fd/hc2vpp/nat/write/ifc/InterfaceOutboundNatCustomizer.java +++ b/nat/nat2vpp/src/main/java/io/fd/hc2vpp/nat/write/ifc/InterfaceOutboundNatCustomizer.java @@ -17,7 +17,7 @@ package io.fd.hc2vpp.nat.write.ifc; import io.fd.hc2vpp.common.translate.util.NamingContext; -import io.fd.vpp.jvpp.snat.future.FutureJVppSnatFacade; +import io.fd.vpp.jvpp.nat.future.FutureJVppNatFacade; import javax.annotation.Nonnull; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang._interface.nat.rev170816._interface.nat.attributes.nat.Outbound; import org.slf4j.Logger; @@ -27,9 +27,9 @@ final class InterfaceOutboundNatCustomizer extends AbstractInterfaceNatCustomize private static final Logger LOG = LoggerFactory.getLogger(InterfaceOutboundNatCustomizer.class); - InterfaceOutboundNatCustomizer(@Nonnull final FutureJVppSnatFacade jvppSnat, + InterfaceOutboundNatCustomizer(@Nonnull final FutureJVppNatFacade jvppNat, @Nonnull final NamingContext ifcContext) { - super(jvppSnat, ifcContext); + super(jvppNat, ifcContext); } @Override diff --git a/nat/nat2vpp/src/main/java/io/fd/hc2vpp/nat/write/ifc/SubIfcNatWriterFactory.java b/nat/nat2vpp/src/main/java/io/fd/hc2vpp/nat/write/ifc/SubIfcNatWriterFactory.java index 23f5ff715..8710acf1b 100644 --- a/nat/nat2vpp/src/main/java/io/fd/hc2vpp/nat/write/ifc/SubIfcNatWriterFactory.java +++ b/nat/nat2vpp/src/main/java/io/fd/hc2vpp/nat/write/ifc/SubIfcNatWriterFactory.java @@ -22,7 +22,7 @@ import io.fd.hc2vpp.common.translate.util.NamingContext; import io.fd.honeycomb.translate.impl.write.GenericWriter; import io.fd.honeycomb.translate.write.WriterFactory; import io.fd.honeycomb.translate.write.registry.ModifiableWriterRegistryBuilder; -import io.fd.vpp.jvpp.snat.future.FutureJVppSnatFacade; +import io.fd.vpp.jvpp.nat.future.FutureJVppNatFacade; 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; @@ -46,21 +46,21 @@ public final class SubIfcNatWriterFactory implements WriterFactory { private static final InstanceIdentifier<Nat> NAT_AUG_ID = SUB_IFC_ID.augmentation(NatSubinterfaceAugmentation.class).child(Nat.class); - private final FutureJVppSnatFacade jvppSnat; + private final FutureJVppNatFacade jvppNat; private final NamingContext ifcContext; @Inject - public SubIfcNatWriterFactory(final FutureJVppSnatFacade jvppSnat, + public SubIfcNatWriterFactory(final FutureJVppNatFacade jvppNat, @Named("interface-context") final NamingContext ifcContext) { - this.jvppSnat = jvppSnat; + this.jvppNat = jvppNat; this.ifcContext = ifcContext; } @Override public void init(@Nonnull final ModifiableWriterRegistryBuilder registry) { registry.addAfter(new GenericWriter<>(NAT_AUG_ID.child(Inbound.class), - new SubInterfaceInboundNatCustomizer(jvppSnat, ifcContext)), SUB_IFC_ID); + new SubInterfaceInboundNatCustomizer(jvppNat, ifcContext)), SUB_IFC_ID); registry.addAfter(new GenericWriter<>(NAT_AUG_ID.child(Outbound.class), - new SubInterfaceOutboundNatCustomizer(jvppSnat, ifcContext)), SUB_IFC_ID); + new SubInterfaceOutboundNatCustomizer(jvppNat, ifcContext)), SUB_IFC_ID); } } diff --git a/nat/nat2vpp/src/main/java/io/fd/hc2vpp/nat/write/ifc/SubInterfaceInboundNatCustomizer.java b/nat/nat2vpp/src/main/java/io/fd/hc2vpp/nat/write/ifc/SubInterfaceInboundNatCustomizer.java index b31fec075..5c4b43aa0 100644 --- a/nat/nat2vpp/src/main/java/io/fd/hc2vpp/nat/write/ifc/SubInterfaceInboundNatCustomizer.java +++ b/nat/nat2vpp/src/main/java/io/fd/hc2vpp/nat/write/ifc/SubInterfaceInboundNatCustomizer.java @@ -17,7 +17,7 @@ package io.fd.hc2vpp.nat.write.ifc; import io.fd.hc2vpp.common.translate.util.NamingContext; -import io.fd.vpp.jvpp.snat.future.FutureJVppSnatFacade; +import io.fd.vpp.jvpp.nat.future.FutureJVppNatFacade; import javax.annotation.Nonnull; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang._interface.nat.rev170816._interface.nat.attributes.nat.Inbound; import org.slf4j.Logger; @@ -27,9 +27,9 @@ final class SubInterfaceInboundNatCustomizer extends AbstractSubInterfaceNatCust private static final Logger LOG = LoggerFactory.getLogger(SubInterfaceInboundNatCustomizer.class); - SubInterfaceInboundNatCustomizer(@Nonnull final FutureJVppSnatFacade jvppSnat, + SubInterfaceInboundNatCustomizer(@Nonnull final FutureJVppNatFacade jvppNat, @Nonnull final NamingContext ifcContext) { - super(jvppSnat, ifcContext); + super(jvppNat, ifcContext); } @Override diff --git a/nat/nat2vpp/src/main/java/io/fd/hc2vpp/nat/write/ifc/SubInterfaceOutboundNatCustomizer.java b/nat/nat2vpp/src/main/java/io/fd/hc2vpp/nat/write/ifc/SubInterfaceOutboundNatCustomizer.java index 281c61c3c..775ea6317 100644 --- a/nat/nat2vpp/src/main/java/io/fd/hc2vpp/nat/write/ifc/SubInterfaceOutboundNatCustomizer.java +++ b/nat/nat2vpp/src/main/java/io/fd/hc2vpp/nat/write/ifc/SubInterfaceOutboundNatCustomizer.java @@ -17,7 +17,7 @@ package io.fd.hc2vpp.nat.write.ifc; import io.fd.hc2vpp.common.translate.util.NamingContext; -import io.fd.vpp.jvpp.snat.future.FutureJVppSnatFacade; +import io.fd.vpp.jvpp.nat.future.FutureJVppNatFacade; import javax.annotation.Nonnull; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang._interface.nat.rev170816._interface.nat.attributes.nat.Outbound; import org.slf4j.Logger; @@ -27,9 +27,9 @@ final class SubInterfaceOutboundNatCustomizer extends AbstractSubInterfaceNatCus private static final Logger LOG = LoggerFactory.getLogger(SubInterfaceOutboundNatCustomizer.class); - SubInterfaceOutboundNatCustomizer(@Nonnull final FutureJVppSnatFacade jvppSnat, + SubInterfaceOutboundNatCustomizer(@Nonnull final FutureJVppNatFacade jvppNat, @Nonnull final NamingContext ifcContext) { - super(jvppSnat, ifcContext); + super(jvppNat, ifcContext); } @Override |