20 #ifndef included_api_h 21 #define included_api_h 36 }) vl_api_trace_file_header_t;
42 #define VLIB_API_INIT_FUNCTION(x) VLIB_DECLARE_INIT_FUNCTION(x,api_init) 45 #define vlib_call_api_init_function(vm, x) \ 47 extern vlib_init_function_t * _VLIB_INIT_FUNCTION_SYMBOL (x,api_init); \ 48 vlib_init_function_t * _f = _VLIB_INIT_FUNCTION_SYMBOL (x,api_init); \ 49 clib_error_t * _error = 0; \ 50 if (! hash_get (vm->init_functions_called, _f)) \ 52 hash_set1 (vm->init_functions_called, _f); \ 58 #define _VL_MSG_API_FUNCTION_SYMBOL(x, type) \ 59 _vl_msg_api_##type##_function_##x 61 #define VL_MSG_API_FUNCTION_SYMBOL(x) \ 62 _VL_MSG_API_FUNCTION_SYMBOL(x, reaper) 64 #define VLIB_DECLARE_REAPER_FUNCTION(x, tag) \ 65 vl_msg_api_init_function_t * _VL_MSG_API_FUNCTION_SYMBOL (x, tag) = x; \ 66 static void __vl_msg_api_add_##tag##_function_##x (void) \ 67 __attribute__((__constructor__)) ; \ 69 static void __vl_msg_api_add_##tag##_function_##x (void) \ 71 api_main_t * am = vlibapi_get_main(); \ 72 static _vl_msg_api_function_list_elt_t _vl_msg_api_function; \ 73 _vl_msg_api_function.next_init_function \ 74 = am->tag##_function_registrations; \ 75 am->tag##_function_registrations = &_vl_msg_api_function; \ 76 _vl_msg_api_function.f = &x; \ 79 #define VL_MSG_API_REAPER_FUNCTION(x) VLIB_DECLARE_REAPER_FUNCTION(x,reaper) 82 #define vl_msg_api_call_reaper_function(ci) \ 84 extern vlib_init_function_t * VLIB_INIT_FUNCTION_SYMBOL (reaper); \ 85 vlib_init_function_t * _f = VLIB_INIT_FUNCTION_SYMBOL (reaper); \ 86 clib_error_t * _error = 0; \ 93 u8 *msg = (
u8 *) msg_arg;
97 return clib_net_to_host_u32 (header->
data_len);
121 u8 * vector,
int include_nexts,
int include_stats);
typedef CLIB_PACKED(struct { u32 nitems;u32 msgtbl_size;u8 wrapped;}) vl_api_trace_file_header_t
u8 * vlib_node_serialize(vlib_main_t *vm, vlib_node_t ***node_dups, u8 *vector, int include_nexts, int include_stats)
void vl_msg_api_add_version(api_main_t *am, const char *string, u32 major, u32 minor, u32 patch)
u32 vl_msg_api_max_length(void *mp)
int vl_msg_api_trace_free(api_main_t *am, vl_api_trace_which_t which)
int vl_msg_api_tx_trace_enabled(api_main_t *am)
vl_api_trace_t * vl_msg_api_trace_get(api_main_t *am, vl_api_trace_which_t which)
API main structure, used by both vpp and binary API clients.
int vl_msg_api_trace_save(api_main_t *am, vl_api_trace_which_t which, FILE *fp)
int vl_msg_api_trace_onoff(api_main_t *am, vl_api_trace_which_t which, int onoff)
void vl_msg_api_trace(api_main_t *am, vl_api_trace_t *tp, void *msg)
vlib_node_t *** vlib_node_unserialize(u8 *vector)
void vl_msg_api_add_msg_name_crc(api_main_t *am, const char *string, u32 id)
u32 data_len
message length not including header
Message header structure.
vl_api_trace_which_t
Trace RX / TX enum.
void vl_msg_api_handler_with_vm_node(api_main_t *am, svm_region_t *vlib_rp, void *the_msg, vlib_main_t *vm, vlib_node_runtime_t *node, u8 is_private)
static u32 vl_msg_api_get_msg_length_inline(void *msg_arg)
int vl_msg_api_rx_trace_enabled(api_main_t *am)
API common definitions See api_doc.md for more info.
u32 vl_msg_api_get_msg_length(void *msg_arg)
int vl_msg_api_trace_configure(api_main_t *am, vl_api_trace_which_t which, u32 nitems)