summaryrefslogtreecommitdiffstats
path: root/vpp-classifier/impl/src/main
diff options
context:
space:
mode:
authorMarek Gradzki <mgradzki@cisco.com>2018-08-10 06:56:36 +0200
committerMarek Gradzki <mgradzki@cisco.com>2018-08-10 07:00:25 +0200
commit446de16ff5c8df1914039b826adbbd0ec5ac2adc (patch)
tree80cddfeeab13f5853546e017b3f80a524a5cd856 /vpp-classifier/impl/src/main
parent69870253c3beae0f5414aa0dc3460b6506c20cec (diff)
Set mask/match length when using VPP's classfier
Adapts hc2vpp to recent VPP api change: https://gerrit.fd.io/r/#/c/13007/ Setting length field is currently mandatory for variable length arrays (VPP-199). Change-Id: I7ce66076d8a29d1ff5dfe5592e651d133e4072aa Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
Diffstat (limited to 'vpp-classifier/impl/src/main')
-rw-r--r--vpp-classifier/impl/src/main/java/io/fd/hc2vpp/vpp/classifier/write/ClassifySessionWriter.java1
-rw-r--r--vpp-classifier/impl/src/main/java/io/fd/hc2vpp/vpp/classifier/write/ClassifyTableWriter.java1
2 files changed, 2 insertions, 0 deletions
diff --git a/vpp-classifier/impl/src/main/java/io/fd/hc2vpp/vpp/classifier/write/ClassifySessionWriter.java b/vpp-classifier/impl/src/main/java/io/fd/hc2vpp/vpp/classifier/write/ClassifySessionWriter.java
index 0e69b33b6..11a48ef14 100644
--- a/vpp-classifier/impl/src/main/java/io/fd/hc2vpp/vpp/classifier/write/ClassifySessionWriter.java
+++ b/vpp-classifier/impl/src/main/java/io/fd/hc2vpp/vpp/classifier/write/ClassifySessionWriter.java
@@ -166,6 +166,7 @@ public class ClassifySessionWriter extends VppNodeWriter
request.advance = classifySession.getAdvance();
request.match = DatatypeConverter.parseHexBinary(classifySession.getMatch().getValue().replace(":", ""));
+ request.matchLen = request.match.length;
return request;
}
diff --git a/vpp-classifier/impl/src/main/java/io/fd/hc2vpp/vpp/classifier/write/ClassifyTableWriter.java b/vpp-classifier/impl/src/main/java/io/fd/hc2vpp/vpp/classifier/write/ClassifyTableWriter.java
index 34e689e5a..8e72df46a 100644
--- a/vpp-classifier/impl/src/main/java/io/fd/hc2vpp/vpp/classifier/write/ClassifyTableWriter.java
+++ b/vpp-classifier/impl/src/main/java/io/fd/hc2vpp/vpp/classifier/write/ClassifyTableWriter.java
@@ -145,6 +145,7 @@ public class ClassifyTableWriter extends VppNodeWriter
request.nextTableIndex = ~0; // value not specified
}
request.mask = DatatypeConverter.parseHexBinary(table.getMask().getValue().replace(":", ""));
+ request.maskLen = request.mask.length;
checkArgument(request.mask.length % 16 == 0, "Number of mask bytes must be multiple of 16.");
request.matchNVectors = request.mask.length / 16;