summaryrefslogtreecommitdiffstats
path: root/v3po
diff options
context:
space:
mode:
authorMarek Gradzki <mgradzki@cisco.com>2017-03-07 17:48:47 +0100
committerMarek Gradzki <mgradzki@cisco.com>2017-03-08 10:58:21 +0000
commit1a11603e9f595a061dd392c6a7e19b1bed9ea0ea (patch)
tree577e79210829961603d13c833cb54e2d1ad52db8 /v3po
parent2c28a58160b7693a1ab11d43def37c41a067eff1 (diff)
Fix match-exact-tags translation for subif
Change-Id: I98203b4e42a65de972faff4ab6d80154ddd10b52 Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
Diffstat (limited to 'v3po')
-rw-r--r--v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfaces/SubInterfaceCustomizer.java11
-rw-r--r--v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfaces/SubInterfaceCustomizerTest.java1
2 files changed, 7 insertions, 5 deletions
diff --git a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfaces/SubInterfaceCustomizer.java b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfaces/SubInterfaceCustomizer.java
index c39cfa6ec..122c327aa 100644
--- a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfaces/SubInterfaceCustomizer.java
+++ b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfaces/SubInterfaceCustomizer.java
@@ -21,11 +21,11 @@ import static io.fd.hc2vpp.v3po.util.SubInterfaceUtils.getNumberOfTags;
import static io.fd.hc2vpp.v3po.util.SubInterfaceUtils.getSubInterfaceName;
import com.google.common.base.Preconditions;
-import io.fd.honeycomb.translate.spi.write.ListWriterCustomizer;
import io.fd.hc2vpp.common.translate.util.ByteDataTranslator;
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.honeycomb.translate.spi.write.ListWriterCustomizer;
import io.fd.honeycomb.translate.write.WriteContext;
import io.fd.honeycomb.translate.write.WriteFailedException;
import io.fd.vpp.jvpp.core.dto.CreateSubif;
@@ -46,7 +46,7 @@ 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.rev161214.interfaces._interface.sub.interfaces.SubInterfaceKey;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev161214.match.attributes.MatchType;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev161214.match.attributes.match.type.Default;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev161214.match.attributes.match.type.vlan.tagged.VlanTagged;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev161214.match.attributes.match.type.VlanTagged;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev161214.sub._interface.base.attributes.tags.Tag;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.slf4j.Logger;
@@ -115,10 +115,11 @@ public class SubInterfaceCustomizer extends FutureJVppCustomizer
// TODO HONEYCOMB-183 match should be mandatory
final MatchType matchType = subInterface.getMatch().getMatchType();
- request.exactMatch =
- booleanToByte(matchType instanceof VlanTagged && ((VlanTagged) matchType).isMatchExactTags());
+ request.exactMatch = booleanToByte(
+ matchType instanceof VlanTagged
+ && ((VlanTagged) matchType).getVlanTagged().isMatchExactTags()
+ );
request.defaultSub = booleanToByte(matchType instanceof Default);
-
if (numberOfTags > 0) {
for (final Tag tag : subInterface.getTags().getTag()) {
if (tag.getIndex() == 0) {
diff --git a/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfaces/SubInterfaceCustomizerTest.java b/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfaces/SubInterfaceCustomizerTest.java
index 4a80e98b6..e2fd4cdb3 100644
--- a/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfaces/SubInterfaceCustomizerTest.java
+++ b/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfaces/SubInterfaceCustomizerTest.java
@@ -140,6 +140,7 @@ public class SubInterfaceCustomizerTest extends WriterCustomizerTest {
: 0);
request.dot1Ad = 1;
request.outerVlanId = STAG_ID;
+ request.exactMatch = 1;
return request;
}