summaryrefslogtreecommitdiffstats
path: root/lisp/lisp2vpp
diff options
context:
space:
mode:
authorJan Srnicek <jsrnicek@cisco.com>2016-09-13 15:17:02 +0200
committerMarek Gradzki <mgradzki@cisco.com>2016-09-13 13:45:08 +0000
commit7f67d7e2a230c96aaf4bd5b842ecf0a346386fa6 (patch)
treebdf6e07b26b2b2865a4c5805f283c453182da079 /lisp/lisp2vpp
parentef9cabddd43ba1721db5cdb25634deec1c48857b (diff)
HONEYCOMB-211 - Fixed locator set filtering
Change-Id: Ia8827040012ea03262727ff5909a68dac9dcb72a Signed-off-by: Jan Srnicek <jsrnicek@cisco.com>
Diffstat (limited to 'lisp/lisp2vpp')
-rwxr-xr-xlisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/read/InterfaceCustomizer.java13
-rw-r--r--lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/read/dump/executor/LocatorDumpExecutor.java5
-rw-r--r--lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/read/dump/executor/params/LocatorDumpParams.java37
3 files changed, 8 insertions, 47 deletions
diff --git a/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/read/InterfaceCustomizer.java b/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/read/InterfaceCustomizer.java
index cc8bbf5ab..46aebded6 100755
--- a/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/read/InterfaceCustomizer.java
+++ b/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/read/InterfaceCustomizer.java
@@ -24,6 +24,7 @@ import com.google.common.base.Optional;
import io.fd.honeycomb.lisp.translate.read.dump.check.LocatorDumpCheck;
import io.fd.honeycomb.lisp.translate.read.dump.executor.LocatorDumpExecutor;
import io.fd.honeycomb.lisp.translate.read.dump.executor.params.LocatorDumpParams;
+import io.fd.honeycomb.lisp.translate.read.dump.executor.params.LocatorDumpParams.LocatorDumpParamsBuilder;
import io.fd.honeycomb.translate.read.ReadContext;
import io.fd.honeycomb.translate.read.ReadFailedException;
import io.fd.honeycomb.translate.spi.read.ListReaderCustomizer;
@@ -100,10 +101,8 @@ public class InterfaceCustomizer
final int referencedInterfaceIndex =
interfaceContext.getIndex(referencedInterfaceName, ctx.getMappingContext());
- final LocatorDumpParams params = new LocatorDumpParams.LocatorDumpParamsBuilder()
- .setFilter(LocatorDumpParams.LocatorDumpFilter.LOCAL)
- .setLocatorSetIndex(locatorSetIndexIndex)
- .build();
+ final LocatorDumpParams params =
+ new LocatorDumpParamsBuilder().setLocatorSetIndex(locatorSetIndexIndex).build();
Optional<LispLocatorDetailsReplyDump> reply;
try {
@@ -136,10 +135,8 @@ public class InterfaceCustomizer
final String name = id.firstKeyOf(LocatorSet.class).getName();
checkState(locatorSetContext.containsIndex(name, context.getMappingContext()), "No mapping for %s", name);
- final LocatorDumpParams params = new LocatorDumpParams.LocatorDumpParamsBuilder()
- .setFilter(LocatorDumpParams.LocatorDumpFilter.LOCAL)
- .setLocatorSetIndex(locatorSetContext.getIndex(name, context.getMappingContext()))
- .build();
+ final LocatorDumpParams params = new LocatorDumpParamsBuilder()
+ .setLocatorSetIndex(locatorSetContext.getIndex(name, context.getMappingContext())).build();
Optional<LispLocatorDetailsReplyDump> reply;
diff --git a/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/read/dump/executor/LocatorDumpExecutor.java b/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/read/dump/executor/LocatorDumpExecutor.java
index 8949f44f2..8bdfd3b6c 100644
--- a/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/read/dump/executor/LocatorDumpExecutor.java
+++ b/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/read/dump/executor/LocatorDumpExecutor.java
@@ -49,9 +49,8 @@ public class LocatorDumpExecutor extends AbstractDumpExecutor
LispLocatorDump request = new LispLocatorDump();
request.lsIndex = params.getLocatorSetIndex();
- // TODO: HONEYCOMB-211: fix support for locator set filtering
- // request.lsName
- // request.filter = params.getFilter();
+ //flag that lsIndex is set
+ request.isIndexSet = (byte) 1;
try {
return TranslateUtils.getReply(vppApi.lispLocatorDump(request).toCompletableFuture());
diff --git a/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/read/dump/executor/params/LocatorDumpParams.java b/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/read/dump/executor/params/LocatorDumpParams.java
index eda1e9771..7528d1d68 100644
--- a/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/read/dump/executor/params/LocatorDumpParams.java
+++ b/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/read/dump/executor/params/LocatorDumpParams.java
@@ -16,65 +16,30 @@
package io.fd.honeycomb.lisp.translate.read.dump.executor.params;
-import static com.google.common.base.Preconditions.checkNotNull;
-
/**
* Params for dumping locators
*/
public final class LocatorDumpParams {
private final int locatorSetIndex;
- private final byte filter;
private LocatorDumpParams(LocatorDumpParamsBuilder builder) {
this.locatorSetIndex = builder.locatorSetIndex;
- this.filter = builder.filter;
}
public int getLocatorSetIndex() {
return locatorSetIndex;
}
- public byte getFilter() {
- return filter;
- }
-
- /**
- * Enum for filtering which locators to dump
- */
- public enum LocatorDumpFilter {
-
- ALL(0),
- LOCAL(1),
- REMOTE(2);
-
- private final int value;
-
- private LocatorDumpFilter(int value) {
- this.value = value;
- }
-
- public final int getValue() {
- return value;
- }
- }
-
public static final class LocatorDumpParamsBuilder {
- public int locatorSetIndex;
- public byte filter;
-
+ private int locatorSetIndex;
public LocatorDumpParamsBuilder setLocatorSetIndex(final int locatorSetIndex) {
this.locatorSetIndex = locatorSetIndex;
return this;
}
- public LocatorDumpParamsBuilder setFilter(final LocatorDumpFilter filter) {
- this.filter = Integer.valueOf(checkNotNull(filter, "Cannot set null filter").getValue()).byteValue();
- return this;
- }
-
public LocatorDumpParams build() {
return new LocatorDumpParams(this);
}