20 #ifndef included_api_h 21 #define included_api_h 94 u8 endian;
u8 wrapped;
96 }) vl_api_trace_file_header_t;
105 #define VL_API_LITTLE_ENDIAN 0x00 106 #define VL_API_BIG_ENDIAN 0x01 117 typedef struct _vl_msg_api_init_function_list_elt
119 struct _vl_msg_api_init_function_list_elt *next_init_function;
121 } _vl_msg_api_function_list_elt_t;
125 void (**msg_handlers) (
void *);
126 int (**pd_msg_handlers) (
void *, int);
127 void (**msg_cleanup_handlers) (
void *);
128 void (**msg_endian_handlers) (
void *);
129 void (**msg_print_handlers) (
void *,
void *);
243 vl_api_trace_which_t which, FILE * fp);
260 void *print,
int msg_size,
int traced);
265 vl_api_trace_which_t which);
275 u16 msg_id_host_byte_order);
285 u32 max_threads,
int include_nexts,
289 #define VLIB_API_INIT_FUNCTION(x) VLIB_DECLARE_INIT_FUNCTION(x,api_init) 292 #define vlib_call_api_init_function(vm, x) \ 294 extern vlib_init_function_t * _VLIB_INIT_FUNCTION_SYMBOL (x,api_init); \ 295 vlib_init_function_t * _f = _VLIB_INIT_FUNCTION_SYMBOL (x,api_init); \ 296 clib_error_t * _error = 0; \ 297 if (! hash_get (vm->init_functions_called, _f)) \ 299 hash_set1 (vm->init_functions_called, _f); \ 306 #define _VL_MSG_API_FUNCTION_SYMBOL(x, type) \ 307 _vl_msg_api_##type##_function_##x 309 #define VL_MSG_API_FUNCTION_SYMBOL(x) \ 310 _VL_MSG_API_FUNCTION_SYMBOL(x, reaper) 312 #define VLIB_DECLARE_REAPER_FUNCTION(x, tag) \ 313 vl_msg_api_init_function_t * _VL_MSG_API_FUNCTION_SYMBOL (x, tag) = x; \ 314 static void __vl_msg_api_add_##tag##_function_##x (void) \ 315 __attribute__((__constructor__)) ; \ 317 static void __vl_msg_api_add_##tag##_function_##x (void) \ 319 api_main_t * am = &api_main; \ 320 static _vl_msg_api_function_list_elt_t _vl_msg_api_function; \ 321 _vl_msg_api_function.next_init_function \ 322 = am->tag##_function_registrations; \ 323 am->tag##_function_registrations = &_vl_msg_api_function; \ 324 _vl_msg_api_function.f = &x; \ 327 #define VL_MSG_API_REAPER_FUNCTION(x) VLIB_DECLARE_REAPER_FUNCTION(x,reaper) 330 #define vl_msg_api_call_reaper_function(ci) \ 332 extern vlib_init_function_t * VLIB_INIT_FUNCTION_SYMBOL (reaper); \ 333 vlib_init_function_t * _f = VLIB_INIT_FUNCTION_SYMBOL (reaper); \ 334 clib_error_t * _error = 0; \
void vl_msg_api_barrier_sync(void)
vlib_node_t ** vlib_node_unserialize(u8 *vector)
void vl_msg_api_post_mortem_dump_enable_disable(int enable)
u8 * vlib_node_serialize(vlib_node_main_t *nm, u8 *vector, u32 max_threads, int include_nexts, int include_stats)
trace_cfg_t * api_trace_cfg
static void cleanup(void)
void vl_msg_api_config(vl_msg_api_msg_config_t *)
void vl_msg_api_set_first_available_msg_id(u16 first_avail)
unix_shared_memory_queue_t * vl_input_queue
void vl_msg_api_post_mortem_dump(void)
struct vl_api_registration_ vl_api_registration_t
_vl_msg_api_function_list_elt_t * reaper_function_registrations
void vl_msg_api_handler_no_free(void *the_msg)
vl_api_registration_t * my_registration
void vl_msg_api_set_handlers(int msg_id, char *msg_name, void *handler, void *cleanup, void *endian, void *print, int msg_size, int traced)
vl_api_trace_t * rx_trace
void vl_msg_api_free(void *)
vl_api_registration_t ** vl_clients
struct vl_shmem_hdr_ * shmem_hdr
void vl_msg_api_cleanup_handler(void *the_msg)
void vl_msg_api_replay_handler(void *the_msg)
int vl_msg_api_trace_free(api_main_t *am, vl_api_trace_which_t which)
vl_registration_type_t registration_type
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)
void vl_msg_api_barrier_release(void)
u32 unprocessed_msg_length
void vl_msg_api_handler_with_vm_node(api_main_t *am, void *the_msg, vlib_main_t *vm, vlib_node_runtime_t *node)
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_set_cleanup_handler(int msg_id, void *fp)
clib_error_t *( vl_msg_api_init_function_t)(u32 client_index)
unix_shared_memory_queue_t * vl_input_queue
unix_shared_memory_queue_t * q
vl_api_msg_range_t * msg_ranges
int vl_msg_api_pd_handler(void *mp, int rv)
void vl_msg_api_trace(api_main_t *am, vl_api_trace_t *tp, void *msg)
void vl_msg_api_register_pd_handler(void *handler, u16 msg_id_host_byte_order)
u32 vl_api_get_msg_index(u8 *name_and_crc)
void vl_msg_api_handler_no_trace_no_free(void *the_msg)
vl_api_trace_t * tx_trace
void vl_msg_api_add_msg_name_crc(api_main_t *am, char *string, u32 id)
u8 * serialized_message_table_in_shmem
typedef CLIB_PACKED(struct{u8 endian;u8 wrapped;u32 nitems;}) vl_api_trace_file_header_t
struct ring_alloc_ * arings
void vl_msg_api_socket_handler(void *the_msg)
void vl_msg_api_trace_only(void *the_msg)
void vl_msg_api_handler(void *the_msg)
u32 vl_api_registration_pool_index
int vl_msg_api_rx_trace_enabled(api_main_t *am)
u16 first_available_msg_id
void vl_msg_api_increment_missing_client_counter(void)
void vl_noop_handler(void *mp)
void vl_msg_api_queue_handler(unix_shared_memory_queue_t *q)
u16 vl_msg_api_get_msg_ids(char *name, int n)
svm_region_t ** mapped_shmem_regions
uword * msg_index_by_name_and_crc
int vl_msg_api_trace_configure(api_main_t *am, vl_api_trace_which_t which, u32 nitems)
uword * msg_range_by_name
struct _unix_shared_memory_queue unix_shared_memory_queue_t