VPP-118: add support for variable length arrays to jvpp

* extends VPP's message definition language with the following syntax:

u32 count:
u8 array[count];

which is traslated to:

u32 count;
u8 array[0];

but now, python API representation generated by vppapigen
contains information about where the array length is stored.

* modifies existing response messages to use the new syntax

Change-Id: I68210bc7a3a755d03d067e9b79a567f40e2d31f3
Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
This commit is contained in:
Marek Gradzki
2016-06-15 16:38:33 +02:00
committed by Dave Wallace
parent 80ee21386c
commit fa42e25c4e
7 changed files with 54 additions and 9 deletions

View File

@ -80,11 +80,15 @@ def get_types(t, filter):
if len(i) is 3: # array type
types_list.append(vpp_2_jni_type_mapping[i[0]] + 'Array')
c_types_list.append(i[0] + '[]')
lengths_list.append(i[2])
lengths_list.append((i[2], False))
elif len(i) is 4: # variable length array type
types_list.append(vpp_2_jni_type_mapping[i[0]] + 'Array')
c_types_list.append(i[0] + '[]')
lengths_list.append((i[3], True))
else: # primitive type
types_list.append(vpp_2_jni_type_mapping[i[0]])
c_types_list.append(i[0])
lengths_list.append(0)
lengths_list.append((0, False))
return types_list, c_types_list, lengths_list