diff options
author | Dave Wallace <dwallacelf@gmail.com> | 2022-02-23 15:36:02 -0500 |
---|---|---|
committer | Dave Wallace <dwallacelf@gmail.com> | 2022-02-25 18:14:22 +0000 |
commit | 9f0c28e7f2203213fa9ea01389d044dcce3f0afe (patch) | |
tree | f37c25d787de9ba2bd73a533762247694a55b7a8 | |
parent | f4df11acf998d15cc6d5850a8febe439c92f31fd (diff) |
vapi: Missing include file in vlib.api.vapi.h
- A call to vapi_msg_control_ping_hton() is generated in
a static inline function in vlib.api.vapi.h, which is
defined/generated in memclnt.api.vapi.h without
including memclnt.api.vapi.h in vlib.api.vapi.h.
This breaks the compilation of plugins which include
only vlib.api.vapi.h (e.g. hicn_plugin from the HICN
project).
Type: fix
Fixes: a1400cecb
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
Change-Id: I5574f4ed496183ea93265f493bf3624254a865a2
(cherry picked from commit 14baada2140ad5a19e4d502e81296fe70b5b54d1)
-rwxr-xr-x | src/vpp-api/vapi/vapi_c_gen.py | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/src/vpp-api/vapi/vapi_c_gen.py b/src/vpp-api/vapi/vapi_c_gen.py index 100263ccbc3..b86115893f9 100755 --- a/src/vpp-api/vapi/vapi_c_gen.py +++ b/src/vpp-api/vapi/vapi_c_gen.py @@ -648,22 +648,6 @@ class CMessage (Message): ]) -vapi_send_with_control_ping = """ -static inline vapi_error_e -vapi_send_with_control_ping (vapi_ctx_t ctx, void *msg, u32 context) -{ - vapi_msg_control_ping *ping = vapi_alloc_control_ping (ctx); - if (!ping) - { - return VAPI_ENOMEM; - } - ping->header.context = context; - vapi_msg_control_ping_hton (ping); - return vapi_send2 (ctx, msg, ping); -} -""" - - def emit_definition(parser, json_file, emitted, o): if o in emitted: return @@ -746,6 +730,8 @@ def gen_json_unified_header(parser, logger, j, io, name): print("") print("static inline vapi_error_e vapi_send_with_control_ping " "(vapi_ctx_t ctx, void * msg, u32 context);") + elif name == "vlib.api.vapi.h": + print("#include <vapi/memclnt.api.vapi.h>") else: print("#include <vapi/vlib.api.vapi.h>") print("") @@ -775,7 +761,21 @@ def gen_json_unified_header(parser, logger, j, io, name): print("") if name == "vlib.api.vapi.h": - print("%s" % vapi_send_with_control_ping) + vapi_send_with_control_ping_function = """ +static inline vapi_error_e +vapi_send_with_control_ping (vapi_ctx_t ctx, void *msg, u32 context) +{ + vapi_msg_control_ping *ping = vapi_alloc_control_ping (ctx); + if (!ping) + { + return VAPI_ENOMEM; + } + ping->header.context = context; + vapi_msg_control_ping_hton (ping); + return vapi_send2 (ctx, msg, ping); +} +""" + print("%s" % vapi_send_with_control_ping_function) print("") print("#ifdef __cplusplus") |