summaryrefslogtreecommitdiffstats
path: root/routing
diff options
context:
space:
mode:
Diffstat (limited to 'routing')
-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;
}