18 #include <sys/types.h> 19 #include <sys/socket.h> 22 #include <netinet/in.h> 65 #define vl_api_version(n,v) static u32 vpe_api_version = v; 66 #include <vpp-api/vpe.api.h> 75 mp->
api_versions[0] = clib_host_to_net_u32 (vpe_api_version);
81 u16 id = ntohs(*((
u16 *)msg));
83 if (
id == VL_API_RX_THREAD_EXIT) {
91 clib_warning(
"Message ID %d has wrong length: %d\n",
id, l);
159 fformat (stdout,
"disconnecting from vpe \n");
165 ep->_vl_msg_id = ntohs(VL_API_RX_THREAD_EXIT);
173 memset (pm, 0,
sizeof (*pm));
187 if (am->
our_pid == 0)
return (-1);
192 u16 msg_id = ntohs(*((
u16 *)msg));
196 printf(
"Unregistered API message: %d\n", msg_id);
201 printf(
"Read failed with %d\n", rv);
215 pneum_client_index (
void)
228 if (!mp)
return (-1);
230 mp->client_index = pneum_client_index();
234 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
void vl_client_add_api_signatures(vl_api_memclnt_create_t *mp)
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
int unix_shared_memory_queue_add(unix_shared_memory_queue_t *q, u8 *elem, int nowait)
int vl_client_api_map(char *region_name)
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,...)
int vl_client_connect(char *name, int ctx_quota, int input_queue_size)
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;})
int pneum_connect(char *name)
int wrap_pneum_callback(char *data, int len)
int pneum_write(char *p, int l)
struct _unix_shared_memory_queue unix_shared_memory_queue_t