summaryrefslogtreecommitdiffstats
path: root/vpp-common/vpp-translate-utils/src
diff options
context:
space:
mode:
authorJan Srnicek <jsrnicek@cisco.com>2017-09-28 13:31:17 +0200
committerJan Srnicek <jsrnicek@cisco.com>2017-09-28 13:31:17 +0200
commit8c31963654d126fa1b670c3d10c0ee81f445166a (patch)
tree1492d8e3dddf11364d8844571a4579895cb34705 /vpp-common/vpp-translate-utils/src
parent1ccfb17154bf025ac320ffea3433cd62bedc221c (diff)
HC2VPP-232 - Secondary table lookup support
Ietf models now contains case table-lookup to be able to define lookup to secondary table. It must be separated to dedicated case as combining secondary-vrf and other next hop types(simple,multi,special) does not make sense, its either you define lookup to table, or you specify next hop of some kind. This patch works properly only for write, as read is affected by VPP-994/VPP-995. Read at this state can detect that route is using table lookup, but can't detect table that is used for that lookup. Also, HC2VPP-237 must be done in future Change-Id: Ia6976b35c6c1712d8add60beea7b0edbc4536974 Signed-off-by: Jan Srnicek <jsrnicek@cisco.com>
Diffstat (limited to 'vpp-common/vpp-translate-utils/src')
-rw-r--r--vpp-common/vpp-translate-utils/src/main/java/io/fd/hc2vpp/common/translate/util/ByteDataTranslator.java8
1 files changed, 8 insertions, 0 deletions
diff --git a/vpp-common/vpp-translate-utils/src/main/java/io/fd/hc2vpp/common/translate/util/ByteDataTranslator.java b/vpp-common/vpp-translate-utils/src/main/java/io/fd/hc2vpp/common/translate/util/ByteDataTranslator.java
index 3424af534..c7583fb52 100644
--- a/vpp-common/vpp-translate-utils/src/main/java/io/fd/hc2vpp/common/translate/util/ByteDataTranslator.java
+++ b/vpp-common/vpp-translate-utils/src/main/java/io/fd/hc2vpp/common/translate/util/ByteDataTranslator.java
@@ -16,6 +16,7 @@
package io.fd.hc2vpp.common.translate.util;
+import java.util.Arrays;
import java.util.Objects;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
@@ -58,6 +59,13 @@ public interface ByteDataTranslator {
}
/**
+ * Checks if provided array contains only zeros
+ */
+ default boolean isArrayZeroed(final byte[] arr) {
+ return Arrays.equals(arr, new byte[arr.length]);
+ }
+
+ /**
* Returns Boolean.TRUE if argument is 0, Boolean.FALSE otherwise.
*
* @param value byte value to be converted