summaryrefslogtreecommitdiffstats
path: root/vpp-api/java
diff options
context:
space:
mode:
authorMarek Gradzki <mgradzki@cisco.com>2016-08-03 10:32:50 +0200
committerMarek Gradzki <mgradzki@cisco.com>2016-08-03 11:42:34 +0200
commit8a1531dfb7c963b530b54d33498c4a035ec03caa (patch)
treef0a1cdb13115803cad27ec37ec732abddf1e6564 /vpp-api/java
parent5ca5dc865143f226e5b6dae002439273856bd88a (diff)
VPP-233: disallow array[0] in reply messages
- updates jvpp generator to raise exception if array[0] is present in reply/detail/counter message - fixes vpe.api reply/detail/counter messages that use incorrect variable array syntax. Additional info: Variable arrays in reply/detail/counter messages needs to have lenght defined in other variable within the message. The other variable can have any name, so it is impossible to generate Java/Python code handling. New syntax introduced by https://gerrit.fd.io/r/#/c/1617/ fixes the problem: u32 some_var; XX array[some_var]; Change-Id: I0af50f1ef1d94d95b56d9326d4e944e72b4edcdd Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
Diffstat (limited to 'vpp-api/java')
-rw-r--r--vpp-api/java/jvpp/gen/jvpp_c_gen.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/vpp-api/java/jvpp/gen/jvpp_c_gen.py b/vpp-api/java/jvpp/gen/jvpp_c_gen.py
index 4d0ea0b51d1..1796ac1719b 100644
--- a/vpp-api/java/jvpp/gen/jvpp_c_gen.py
+++ b/vpp-api/java/jvpp/gen/jvpp_c_gen.py
@@ -412,6 +412,11 @@ def generate_msg_handlers(func_list, inputfile):
c_name = t[2]
field_length = t[3][0]
+ if jni_type.endswith('Array') and field_length == '0':
+ raise Exception('Variable array \'%s\' defined in message \'%s\' '
+ 'should have defined length (e.g. \'%s[%s_length]\''
+ % (c_name, handler_name, c_name, c_name))
+
# check if we are processing variable length array
if t[3][1]:
length_var_name = t[3][0]