summaryrefslogtreecommitdiffstats
path: root/src/vpp-api/java/jvpp/gen/jvpp_gen.py
diff options
context:
space:
mode:
authorMarek Gradzki <mgradzki@cisco.com>2017-05-12 18:24:34 +0200
committerDamjan Marion <dmarion.lists@gmail.com>2017-05-15 17:27:01 +0000
commited76d5f2e383834d8c6aae8ab3b89cf7d2479d0c (patch)
tree52c89a33fbedcf44d5b7ddf2356a678c588efe0c /src/vpp-api/java/jvpp/gen/jvpp_gen.py
parent0194f1aeefaf9917e0303ca36969a22f320d4444 (diff)
jvpp: fix memory allocation for variable lenght messages (VPP-841)
Change-Id: I9a46125e3cf9815c08cf8cca17713ec6e9121eae Signed-off-by: Marek Gradzki <mgradzki@cisco.com> (cherry picked from commit 307cfd8eb14ff7df04316ffa56f2c2481d650d7e)
Diffstat (limited to 'src/vpp-api/java/jvpp/gen/jvpp_gen.py')
-rwxr-xr-xsrc/vpp-api/java/jvpp/gen/jvpp_gen.py14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/vpp-api/java/jvpp/gen/jvpp_gen.py b/src/vpp-api/java/jvpp/gen/jvpp_gen.py
index 2a5ada989bb..7932741d94a 100755
--- a/src/vpp-api/java/jvpp/gen/jvpp_gen.py
+++ b/src/vpp-api/java/jvpp/gen/jvpp_gen.py
@@ -96,14 +96,16 @@ def is_response_field(field_name):
def get_args(t, filter):
- arg_list = []
+ arg_names = []
+ arg_types = []
for i in t:
if is_crc(i):
continue
if not filter(i[1]):
continue
- arg_list.append(i[1])
- return arg_list
+ arg_types.append(i[0])
+ arg_names.append(i[1])
+ return arg_types, arg_names
def get_types(t, filter):
@@ -143,16 +145,18 @@ def get_definitions(defs):
# For replies include all the arguments except message_id
if util.is_reply(java_name):
types, lengths, crc = get_types(a[1:], is_response_field)
+ args = get_args(a[1:], is_response_field)
func_name[a[0]] = dict(
[('name', a[0]), ('java_name', java_name),
- ('args', get_args(a[1:], is_response_field)), ('full_args', get_args(a[1:], lambda x: True)),
+ ('args', args[1]), ('arg_types', args[0]),
('types', types), ('lengths', lengths), crc])
# For requests skip message_id, client_id and context
else:
types, lengths, crc = get_types(a[1:], is_request_field)
+ args = get_args(a[1:], is_request_field)
func_name[a[0]] = dict(
[('name', a[0]), ('java_name', java_name),
- ('args', get_args(a[1:], is_request_field)), ('full_args', get_args(a[1:], lambda x: True)),
+ ('args', args[1]), ('arg_types', args[0]),
('types', types), ('lengths', lengths), crc])
# Indexed by name