summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Srnicek <jsrnicek@cisco.com>2017-02-22 07:54:52 +0100
committerJan Srnicek <jsrnicek@cisco.com>2017-02-22 07:38:54 +0000
commit67a9ab2f45b439f1272a2befc065571d8e90cb8b (patch)
treed1dea39970cf56540d3173e3b497bd09c766c1c1
parent10adb19d1ae404220424f1d53b7f42c5d8bc56e7 (diff)
HC2VPP-74 - mpls vs ipv4 route
Added mpls invalid label to not resolve route as mpls Change-Id: I43f82b8074512ab8e9a28ff02ef80bf52213c3c4 Signed-off-by: Jan Srnicek <jsrnicek@cisco.com>
-rw-r--r--routing/routing-impl/src/main/java/io/fd/hc2vpp/routing/write/trait/RouteRequestProducer.java19
-rw-r--r--routing/routing-impl/src/test/java/io/fd/hc2vpp/routing/helpers/RoutingRequestTestHelper.java2
2 files changed, 14 insertions, 7 deletions
diff --git a/routing/routing-impl/src/main/java/io/fd/hc2vpp/routing/write/trait/RouteRequestProducer.java b/routing/routing-impl/src/main/java/io/fd/hc2vpp/routing/write/trait/RouteRequestProducer.java
index 63ee5a13e..458aac165 100644
--- a/routing/routing-impl/src/main/java/io/fd/hc2vpp/routing/write/trait/RouteRequestProducer.java
+++ b/routing/routing-impl/src/main/java/io/fd/hc2vpp/routing/write/trait/RouteRequestProducer.java
@@ -16,11 +16,6 @@
package io.fd.hc2vpp.routing.write.trait;
-import static com.google.common.base.Preconditions.checkArgument;
-import static com.google.common.base.Preconditions.checkNotNull;
-import static java.util.Objects.isNull;
-import static org.apache.commons.lang3.StringUtils.isNotEmpty;
-
import com.google.common.collect.ImmutableSet.Builder;
import io.fd.hc2vpp.common.translate.util.AddressTranslator;
import io.fd.hc2vpp.common.translate.util.ByteDataTranslator;
@@ -28,12 +23,18 @@ import io.fd.hc2vpp.common.translate.util.JvppReplyConsumer;
import io.fd.hc2vpp.v3po.vppclassifier.VppClassifierContextManager;
import io.fd.honeycomb.translate.MappingContext;
import io.fd.vpp.jvpp.core.dto.IpAddDelRoute;
-import java.util.Set;
-import java.util.regex.Pattern;
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.inet.types.rev130715.Ipv6Prefix;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.vpp.routing.rev161214.VniReference;
+import java.util.Set;
+import java.util.regex.Pattern;
+
+import static com.google.common.base.Preconditions.checkArgument;
+import static com.google.common.base.Preconditions.checkNotNull;
+import static java.util.Objects.isNull;
+import static org.apache.commons.lang3.StringUtils.isNotEmpty;
+
/**
* Common logic for writing of routes
@@ -47,6 +48,8 @@ public interface RouteRequestProducer extends ByteDataTranslator, AddressTransla
byte DEFAULT_CLASSIFY_TABLE_INDEX = 0;
byte DEFAULT_HOP_WEIGHT = 0;
+ int MPLS_LABEL_INVALID = 0x100000;
+
default int mandatoryVni(final VniReference vniReference) {
return checkNotNull(vniReference, "Vni reference cannot be null").getValue().intValue();
}
@@ -133,6 +136,8 @@ public interface RouteRequestProducer extends ByteDataTranslator, AddressTransla
request.classifyTableIndex = classifyTableIndex;
request.isClassify = classifyTableSet;
+ request.nextHopViaLabel = MPLS_LABEL_INVALID;
+
return request;
}
}
diff --git a/routing/routing-impl/src/test/java/io/fd/hc2vpp/routing/helpers/RoutingRequestTestHelper.java b/routing/routing-impl/src/test/java/io/fd/hc2vpp/routing/helpers/RoutingRequestTestHelper.java
index 2194dfba7..7c3ddee2e 100644
--- a/routing/routing-impl/src/test/java/io/fd/hc2vpp/routing/helpers/RoutingRequestTestHelper.java
+++ b/routing/routing-impl/src/test/java/io/fd/hc2vpp/routing/helpers/RoutingRequestTestHelper.java
@@ -25,6 +25,7 @@ import static org.mockito.Mockito.when;
import io.fd.hc2vpp.common.test.util.FutureProducer;
import io.fd.hc2vpp.common.translate.util.ByteDataTranslator;
import io.fd.hc2vpp.routing.trait.RouteMapper;
+import io.fd.hc2vpp.routing.write.trait.RouteRequestProducer;
import io.fd.honeycomb.translate.util.RWUtils;
import io.fd.vpp.jvpp.core.dto.IpAddDelRoute;
import io.fd.vpp.jvpp.core.dto.IpAddDelRouteReply;
@@ -113,6 +114,7 @@ public interface RoutingRequestTestHelper extends ByteDataTranslator, FutureProd
request.isLocal = toByte(isLocal);
request.isUnreach = toByte(isUnreach);
request.isProhibit = toByte(isProhibit);
+ request.nextHopViaLabel = RouteRequestProducer.MPLS_LABEL_INVALID;
return request;
}