23 #include <sys/types.h> 26 #include <netinet/in.h> 59 #define vl_print(handle, ...) clib_warning (__VA_ARGS__) 111 #define foreach_api_msg \ 112 _(RX_THREAD_EXIT, rx_thread_exit) 116 int rx_queue_size,
int want_pthread)
128 vl_msg_api_set_handlers(VL_API_##N, #n, \ 129 vl_api_##n##_t_handler, \ 131 vl_api_##n##_t_endian, \ 132 vl_api_##n##_t_print, \ 133 sizeof(vl_api_##n##_t), 1); 185 ep->_vl_msg_id = ntohs (VL_API_RX_THREAD_EXIT);
194 memset (mm, 0,
sizeof (*mm));
218 if (strlen (plugin_name) + 1 >
sizeof (mp->
name))
221 memset (&clib_time, 0,
sizeof (clib_time));
225 old_handler = am->
msg_handlers[VL_API_GET_FIRST_MSG_ID_REPLY];
226 am->
msg_handlers[VL_API_GET_FIRST_MSG_ID_REPLY] = (
void *)
233 memset (mp, 0,
sizeof (*mp));
234 mp->_vl_msg_id = ntohs (VL_API_GET_FIRST_MSG_ID);
236 strncpy ((
char *) mp->
name, plugin_name, sizeof (mp->
name) - 1);
254 am->
msg_handlers[VL_API_GET_FIRST_MSG_ID_REPLY] = old_handler;
263 am->
msg_handlers[VL_API_GET_FIRST_MSG_ID_REPLY] = old_handler;
266 clib_warning (
"plugin '%s' not registered", plugin_name);
static int connect_to_vlib_internal(char *svm_name, char *client_name, int rx_queue_size, int want_pthread)
void vl_msg_api_send_shmem(unix_shared_memory_queue_t *q, u8 *elem)
u8 rx_thread_jmpbuf_valid
Fixed length block allocator.
unix_shared_memory_queue_t * vl_input_queue
static f64 clib_time_now(clib_time_t *c)
static void noop_handler(void *notused)
unix_shared_memory_queue_t * vl_input_queue
pthread_t rx_thread_handle
void vl_msg_api_free(void *)
static void * rx_thread_fn(void *arg)
struct vl_shmem_hdr_ * shmem_hdr
int vl_client_connect_to_vlib(char *svm_name, char *client_name, int rx_queue_size)
int vl_client_api_map(char *region_name)
u16 vl_client_get_first_plugin_msg_id(char *plugin_name)
void clib_time_init(clib_time_t *c)
void * vl_msg_api_alloc(int nbytes)
#define clib_warning(format, args...)
void vlib_node_sync_stats(vlib_main_t *vm, vlib_node_t *n)
int vl_client_connect(char *name, int ctx_quota, int input_queue_size)
Bitmaps built as vectors of machine words.
int vl_client_connect_to_vlib_no_rx_pthread(char *svm_name, char *client_name, int rx_queue_size)
void vl_client_disconnect(void)
void vl_client_api_unmap(void)
static void vl_api_get_first_msg_id_reply_t_handler(vl_api_get_first_msg_id_reply_t *mp)
static void vl_api_rx_thread_exit_t_handler(vl_api_rx_thread_exit_t *mp)
memory_client_main_t memory_client_main
void(** msg_handlers)(void *)
void vl_client_disconnect_from_vlib(void)
void vl_msg_api_queue_handler(unix_shared_memory_queue_t *q)
volatile u8 first_msg_id_reply_ready
CLIB vectors are ubiquitous dynamically resized arrays with by user defined "headers".
struct _unix_shared_memory_queue unix_shared_memory_queue_t