From 3196c5888d01a41aaa9cba115a4e92572e8890ae Mon Sep 17 00:00:00 2001 From: Marek Gradzki Date: Mon, 5 Sep 2016 13:31:39 +0200 Subject: HONEYCOMB-153: fix acls for sub-interfaces Change-Id: Ia75c2ebd62fb371fd60f860fe12761926f443b98 Signed-off-by: Marek Gradzki --- .../v3po/interfaces/SubInterfaceCustomizer.java | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) (limited to 'v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/interfaces/SubInterfaceCustomizer.java') diff --git a/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/interfaces/SubInterfaceCustomizer.java b/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/interfaces/SubInterfaceCustomizer.java index 38164bfbb..bfaa42e44 100644 --- a/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/interfaces/SubInterfaceCustomizer.java +++ b/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/interfaces/SubInterfaceCustomizer.java @@ -17,18 +17,18 @@ package io.fd.honeycomb.translate.v3po.interfaces; import static com.google.common.base.Preconditions.checkState; +import static io.fd.honeycomb.translate.v3po.util.SubInterfaceUtils.getNumberOfTags; import static io.fd.honeycomb.translate.v3po.util.SubInterfaceUtils.getSubInterfaceName; import static io.fd.honeycomb.translate.v3po.util.TranslateUtils.booleanToByte; import com.google.common.base.Preconditions; import io.fd.honeycomb.translate.spi.write.ListWriterCustomizer; import io.fd.honeycomb.translate.v3po.util.FutureJVppCustomizer; -import io.fd.honeycomb.translate.v3po.util.WriteTimeoutException; -import io.fd.honeycomb.translate.write.WriteContext; import io.fd.honeycomb.translate.v3po.util.NamingContext; import io.fd.honeycomb.translate.v3po.util.TranslateUtils; +import io.fd.honeycomb.translate.v3po.util.WriteTimeoutException; +import io.fd.honeycomb.translate.write.WriteContext; import io.fd.honeycomb.translate.write.WriteFailedException; -import java.util.List; import java.util.Objects; import java.util.concurrent.CompletionStage; import javax.annotation.Nonnull; @@ -44,7 +44,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev150527.match.attributes.MatchType; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev150527.match.attributes.match.type.Default; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev150527.match.attributes.match.type.vlan.tagged.VlanTagged; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev150527.sub._interface.base.attributes.Tags; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev150527.sub._interface.base.attributes.tags.Tag; import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; import org.openvpp.jvpp.VppBaseCallException; @@ -108,7 +107,7 @@ public class SubInterfaceCustomizer extends FutureJVppCustomizer request.subId = Math.toIntExact(subInterface.getIdentifier().intValue()); request.swIfIndex = swIfIndex; - final int numberOfTags = getNumberOfTags(subInterface); + final int numberOfTags = getNumberOfTags(subInterface.getTags()); switch (numberOfTags) { case 0: request.noTags = 1; @@ -155,18 +154,6 @@ public class SubInterfaceCustomizer extends FutureJVppCustomizer request.innerVlanIdAny = booleanToByte(Dot1qTag.VlanId.Enumeration.Any.equals(vlanId.getEnumeration())); } - private static int getNumberOfTags(@Nonnull final SubInterface subInterface) { - final Tags tags = subInterface.getTags(); - if (tags == null) { - return 0; - } - final List tagList = tags.getTag(); - if (tagList == null) { - return 0; - } - return tagList.size(); - } - private static short dot1qVlanIdToShort(@Nullable Dot1qVlanId dot1qVlanId) { if (dot1qVlanId == null) { return 0; // tell VPP that optional argument is missing -- cgit 1.2.3-korg