18 #include <sys/types.h> 19 #include <sys/socket.h> 22 #include <netinet/in.h> 77 u16 id = ntohs(*((
u16 *)msg));
78 if (
id == VL_API_RX_THREAD_EXIT) {
86 clib_warning(
"Message ID %d has wrong length: %d\n",
id, l);
134 if (chroot_prefix !=
NULL)
173 ep->_vl_msg_id = ntohs(VL_API_RX_THREAD_EXIT);
182 memset (pm, 0,
sizeof (*pm));
199 if (am->
our_pid == 0)
return (-1);
204 u16 msg_id = ntohs(*((
u16 *)msg));
208 printf(
"Unregistered API message: %d\n", msg_id);
213 printf(
"Read failed with %d\n", rv);
227 pneum_client_index (
void)
242 if (!mp)
return (-1);
244 mp->client_index = pneum_client_index();
248 printf(
"vpe_api_write fails: %d\n", rv);
u8 rx_thread_jmpbuf_valid
pthread_t rx_thread_handle
void vl_msg_api_send_shmem(unix_shared_memory_queue_t *q, u8 *elem)
unix_shared_memory_queue_t * vl_input_queue
vlib_main_t ** vlib_mains
int pneum_read(char **p, int *l)
unix_shared_memory_queue_t * vl_input_queue
static void * pneum_rx_thread_fn(void *arg)
void vl_msg_api_free(void *)
#define clib_warning(format, args...)
struct vl_shmem_hdr_ * shmem_hdr
vlib_main_t vlib_global_main
int unix_shared_memory_queue_add(unix_shared_memory_queue_t *q, u8 *elem, int nowait)
int vl_client_api_map(char *region_name)
void vl_set_memory_root_path(char *root_path)
void(* pneum_callback_t)(unsigned char *data, int len)
int pneum_connect(char *name, char *chroot_prefix, pneum_callback_t cb)
int pneum_disconnect(void)
int unix_shared_memory_queue_sub(unix_shared_memory_queue_t *q, u8 *elem, int nowait)
void * vl_msg_api_alloc(int nbytes)
static void pneum_api_handler(void *msg)
void vlib_cli_output(struct vlib_main_t *vm, char *fmt,...)
u32 vl_api_get_msg_index(u8 *name_and_crc)
int vl_client_connect(char *name, int ctx_quota, int input_queue_size)
static uword hash_elts(void *v)
void pneum_free(void *msg)
void vl_client_disconnect(void)
void vl_client_api_unmap(void)
typedef VL_API_PACKED(struct _vl_api_header{u16 _vl_msg_id;u32 client_index;})
pneum_callback_t pneum_callback
uword * pneum_msg_table_get_hash(void)
uint32_t pneum_get_msg_index(unsigned char *name)
int pneum_msg_table_size(void)
uword * msg_index_by_name_and_crc
int pneum_write(char *p, int l)
struct _unix_shared_memory_queue unix_shared_memory_queue_t