summaryrefslogtreecommitdiffstats
path: root/extras/japi/java/jvpp
diff options
context:
space:
mode:
authorMichal Cmarada <mcmarada@cisco.com>2019-01-04 13:29:25 +0100
committerMichal Cmarada <mcmarada@cisco.com>2019-01-04 13:29:25 +0100
commit6ebc6eb3d27e0abbc66dbb2548808e1a338f89b4 (patch)
tree2d5348da51e9a16099eb904efbae49845b99177a /extras/japi/java/jvpp
parentb56fcf14d8a8801b24d373f519b36df2b2879b72 (diff)
VPP-1525: additional fixes for strings in Japi
Change-Id: Ic5aa09fdc360cdded16d3c4693f0d4b2067f66d6 Signed-off-by: Michal Cmarada <mcmarada@cisco.com>
Diffstat (limited to 'extras/japi/java/jvpp')
-rwxr-xr-xextras/japi/java/jvpp/gen/jvppgen/jni_impl_gen.py3
-rwxr-xr-xextras/japi/java/jvpp/gen/jvppgen/jvpp_model.py2
2 files changed, 3 insertions, 2 deletions
diff --git a/extras/japi/java/jvpp/gen/jvppgen/jni_impl_gen.py b/extras/japi/java/jvpp/gen/jvppgen/jni_impl_gen.py
index 717a42c452a..2941778f208 100755
--- a/extras/japi/java/jvpp/gen/jvppgen/jni_impl_gen.py
+++ b/extras/japi/java/jvpp/gen/jvppgen/jni_impl_gen.py
@@ -111,5 +111,6 @@ def _generate_msg_size(msg):
_size_components += " + %s*sizeof(%s)" % (field.array_len_field.java_name, field.type.base_type.vpp_name)
# FIXME(VPP-586): for proper nested structures support, we need generate functions computing type sizes
# and use it instead of sizeof
-
+ if field.type.name == "string":
+ _size_components += " + jstr_length(env, %s) * sizeof(u8)" % field.name
return msg_size + "".join(_size_components)
diff --git a/extras/japi/java/jvpp/gen/jvppgen/jvpp_model.py b/extras/japi/java/jvpp/gen/jvppgen/jvpp_model.py
index da1e01f5a63..9a3204e3fc6 100755
--- a/extras/japi/java/jvpp/gen/jvppgen/jvpp_model.py
+++ b/extras/japi/java/jvpp/gen/jvppgen/jvpp_model.py
@@ -447,7 +447,7 @@ class JVppModel(object):
host_to_net_function='clib_host_to_net_i64',
net_to_host_function='clib_net_to_host_i64'),
'f64': SimpleType('f64', 'double', 'D', 'jdouble', 'Double'),
- 'string': SimpleType('string', 'String', 'l', 'jstring', 'Object',
+ 'string': SimpleType('string', 'String', 'Ljava/lang/String;', 'jstring', 'Object',
host_to_net_function='_host_to_net_string',
net_to_host_function='_net_to_host_string')
})