summaryrefslogtreecommitdiffstats
path: root/vpp-api/java/jvpp/gen
diff options
context:
space:
mode:
authorMarek Gradzki <mgradzki@cisco.com>2016-05-30 21:52:37 +0200
committerDave Wallace <dwallacelf@gmail.com>2016-05-31 21:19:07 +0000
commit34e7772443f57f4fa561b4affb682329fb9f3bc4 (patch)
tree4d6e3a708a180417f1757675abc19d7633b5d196 /vpp-api/java/jvpp/gen
parentcb51846ae00fba9b0792fb284635e2e7b9d5fd34 (diff)
Fix u16 type handling in jvpp
Change-Id: I6e5ed2562c65dde6c9f6f085c8b9d40f80684894 Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
Diffstat (limited to 'vpp-api/java/jvpp/gen')
-rw-r--r--vpp-api/java/jvpp/gen/jvpp_c_gen.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/vpp-api/java/jvpp/gen/jvpp_c_gen.py b/vpp-api/java/jvpp/gen/jvpp_c_gen.py
index c02c826fc49..476a768d9a0 100644
--- a/vpp-api/java/jvpp/gen/jvpp_c_gen.py
+++ b/vpp-api/java/jvpp/gen/jvpp_c_gen.py
@@ -116,7 +116,7 @@ vl_api_ip6_fib_counter_t_array_struct_setter_template = Template("""
// vl_api_ip6_fib_counter_t_array_field_setter_template FIXME""")
struct_setter_templates = {'u8': u8_struct_setter_template,
- 'u16': u32_struct_setter_template,
+ 'u16': u16_struct_setter_template,
'u32': u32_struct_setter_template,
'i32': u32_struct_setter_template,
'u64': u64_struct_setter_template,
@@ -218,6 +218,10 @@ default_dto_field_setter_template = Template("""
(*env)->Set${jni_setter}(env, dto, ${java_name}FieldId, mp->${c_name});
""")
+u16_dto_field_setter_template = Template("""
+ (*env)->Set${jni_setter}(env, dto, ${java_name}FieldId, clib_net_to_host_u16(mp->${c_name}));
+""")
+
u32_dto_field_setter_template = Template("""
(*env)->Set${jni_setter}(env, dto, ${java_name}FieldId, clib_net_to_host_u32(mp->${c_name}));
""")
@@ -247,11 +251,11 @@ u64_array_dto_field_setter_template = Template("""
""")
dto_field_setter_templates = {'u8': default_dto_field_setter_template,
- 'u16': u32_dto_field_setter_template,
+ 'u16': u16_dto_field_setter_template,
'u32': u32_dto_field_setter_template,
'i32': u32_dto_field_setter_template,
'u64': u64_dto_field_setter_template,
- 'f64': default_dto_field_setter_template,
+ 'f64': default_dto_field_setter_template, #fixme
'u64[]': u64_array_dto_field_setter_template,
'u8[]': u8_array_dto_field_setter_template
}