diff options
Diffstat (limited to 'nat/nat2vpp/src/main/java/io/fd/hc2vpp/nat/read/ifc/SubInterfaceInboundNatCustomizer.java')
-rw-r--r-- | nat/nat2vpp/src/main/java/io/fd/hc2vpp/nat/read/ifc/SubInterfaceInboundNatCustomizer.java | 46 |
1 files changed, 25 insertions, 21 deletions
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<SnatInterfaceDetailsReplyDump, Void> 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<Inbound> 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); } } |