23 #include <sys/types.h> 26 #include <netinet/in.h> 59 #define vl_print(handle, ...) clib_warning (__VA_ARGS__) 106 #define foreach_api_msg \ 107 _(RX_THREAD_EXIT, rx_thread_exit) 110 int rx_queue_size,
int want_pthread)
121 vl_msg_api_set_handlers(VL_API_##N, #n, \ 122 vl_api_##n##_t_handler, \ 124 vl_api_##n##_t_endian, \ 125 vl_api_##n##_t_print, \ 126 sizeof(vl_api_##n##_t), 1); 131 rx_queue_size ) < 0) {
172 ep->_vl_msg_id = ntohs(VL_API_RX_THREAD_EXIT);
180 memset (mm, 0,
sizeof (*mm));
203 if (strlen(plugin_name) + 1 >
sizeof (mp->
name))
206 memset (&clib_time, 0,
sizeof (clib_time));
210 old_handler = am->
msg_handlers[VL_API_GET_FIRST_MSG_ID_REPLY];
211 am->
msg_handlers[VL_API_GET_FIRST_MSG_ID_REPLY] = (
void *)
218 memset (mp, 0,
sizeof (*mp));
219 mp->_vl_msg_id = ntohs(VL_API_GET_FIRST_MSG_ID);
221 strncpy ((
char *) mp->
name, plugin_name, sizeof (mp->
name) - 1);
236 am->
msg_handlers[VL_API_GET_FIRST_MSG_ID_REPLY] = old_handler;
244 am->
msg_handlers[VL_API_GET_FIRST_MSG_ID_REPLY] = old_handler;
247 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
unix_shared_memory_queue_t * vl_input_queue
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)
#define clib_warning(format, args...)
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)
always_inline f64 clib_time_now(clib_time_t *c)
void clib_time_init(clib_time_t *c)
void * vl_msg_api_alloc(int nbytes)
int vl_client_connect(char *name, int ctx_quota, int input_queue_size)
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