From 33ecedc83c01e4d33e8304d9759100dcd95cb244 Mon Sep 17 00:00:00 2001 From: Marek Gradzki Date: Tue, 1 Aug 2017 13:43:14 +0200 Subject: HC2VPP-197: translation layert for post routing NAT Change-Id: Icef6682fbc7a18a1e52953270ad26f6b3b7676eb Signed-off-by: Marek Gradzki --- .../read/ifc/SubInterfaceInboundNatCustomizer.java | 46 ++++++++++++---------- 1 file changed, 25 insertions(+), 21 deletions(-) (limited to 'nat/nat2vpp/src/main/java/io/fd/hc2vpp/nat/read/ifc/SubInterfaceInboundNatCustomizer.java') 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 1d6cff916..84e211fea 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,9 +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.honeycomb.translate.util.read.cache.DumpCacheManager; -import io.fd.vpp.jvpp.snat.dto.SnatInterfaceDetails; -import io.fd.vpp.jvpp.snat.dto.SnatInterfaceDetailsReplyDump; +import io.fd.vpp.jvpp.snat.future.FutureJVppSnatFacade; 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; @@ -45,10 +43,9 @@ final class SubInterfaceInboundNatCustomizer extends AbstractSubInterfaceNatCust private static final Logger LOG = LoggerFactory.getLogger(SubInterfaceInboundNatCustomizer.class); - SubInterfaceInboundNatCustomizer( - @Nonnull final DumpCacheManager dumpMgr, - @Nonnull final NamingContext ifcContext) { - super(dumpMgr, ifcContext); + SubInterfaceInboundNatCustomizer(@Nonnull final FutureJVppSnatFacade jvppSnat, + @Nonnull final NamingContext ifcContext) { + super(jvppSnat, ifcContext); } @Override @@ -57,8 +54,13 @@ final class SubInterfaceInboundNatCustomizer extends AbstractSubInterfaceNatCust } @Override - boolean isExpectedNatType(final SnatInterfaceDetails snatInterfaceDetails) { - return snatInterfaceDetails.isInside == 1; + boolean isExpectedNatType(final int isInside) { + return isInside == 1; + } + + @Override + void setPostRouting(final InboundBuilder builder) { + builder.setPostRouting(true); } @Nonnull @@ -79,18 +81,20 @@ final class SubInterfaceInboundNatCustomizer extends AbstractSubInterfaceNatCust @Nonnull final Inbound readValue, @Nonnull final ReadContext ctx) { final InstanceIdentifier cfgId = - InstanceIdentifier.create(Interfaces.class) - .child(Interface.class, - new InterfaceKey(id.firstKeyOf( - org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.Interface.class).getName())) - .augmentation(SubinterfaceAugmentation.class) - .child(SubInterfaces.class) - .child(SubInterface.class, - new SubInterfaceKey(id.firstKeyOf( - org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev170607.interfaces.state._interface.sub.interfaces.SubInterface.class).getIdentifier())) - .augmentation(NatSubinterfaceAugmentation.class) - .child(Nat.class) - .child(Inbound.class); + InstanceIdentifier.create(Interfaces.class) + .child(Interface.class, + new InterfaceKey(id.firstKeyOf( + org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.Interface.class) + .getName())) + .augmentation(SubinterfaceAugmentation.class) + .child(SubInterfaces.class) + .child(SubInterface.class, + new SubInterfaceKey(id.firstKeyOf( + org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev170607.interfaces.state._interface.sub.interfaces.SubInterface.class) + .getIdentifier())) + .augmentation(NatSubinterfaceAugmentation.class) + .child(Nat.class) + .child(Inbound.class); return Initialized.create(cfgId, readValue); } } -- cgit 1.2.3-korg