X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvpp-api%2Fvapi%2Fvapi_c_gen.py;fp=src%2Fvpp-api%2Fvapi%2Fvapi_c_gen.py;h=b86115893f964a013c6c5915cf549d30c9772746;hb=6081dda84b8f4831d0a53a9fbfcdc9518c234ba7;hp=100263ccbc311818ddb2da413bc935c31a06db42;hpb=35d2ba93314cc03def4bf1548276f1c4caac50b4;p=vpp.git 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 ") else: print("#include ") 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")