FD.io VPP  v18.01.2-1-g9b554f3
Vector Packet Processing
api_common.h File Reference
+ Include dependency graph for api_common.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  ring_alloc_
 
struct  vl_shmem_hdr_
 
struct  vl_socket_args_for_process_t
 
struct  socket_main_t
 
struct  socket_client_main_t
 

Macros

#define foreach_vl_aring_size
 
#define foreach_clnt_aring_size
 
#define VL_SHM_VERSION   2
 
#define VL_API_EPOCH_MASK   0xFF
 
#define VL_API_EPOCH_SHIFT   8
 
#define QUEUE_SIGNAL_EVENT   1
 
#define SOCKET_READ_EVENT   2
 
#define API_SOCKET_FILE   "/run/vpp-api.sock"
 
#define SOCKET_CLIENT_DEFAULT_BUFFER_SIZE   4096
 

Typedefs

typedef struct ring_alloc_ ring_alloc_t
 
typedef struct vl_shmem_hdr_ vl_shmem_hdr_t
 

Functions

void * vl_msg_api_alloc (int nbytes)
 
void * vl_msg_api_alloc_or_null (int nbytes)
 
void * vl_msg_api_alloc_as_if_client (int nbytes)
 
void * vl_msg_api_alloc_as_if_client_or_null (int nbytes)
 
void vl_msg_api_free (void *a)
 
int vl_map_shmem (const char *region_name, int is_vlib)
 
void vl_register_mapped_shmem_region (svm_region_t *rp)
 
void vl_unmap_shmem (void)
 
void vl_msg_api_send_shmem (unix_shared_memory_queue_t *q, u8 *elem)
 
void vl_msg_api_send_shmem_nolock (unix_shared_memory_queue_t *q, u8 *elem)
 
void vl_msg_api_send (vl_api_registration_t *rp, u8 *elem)
 
int vl_client_connect (const char *name, int ctx_quota, int input_queue_size)
 
void vl_client_disconnect (void)
 
unix_shared_memory_queue_tvl_api_client_index_to_input_queue (u32 index)
 
vl_api_registration_tvl_api_client_index_to_registration (u32 index)
 
int vl_client_api_map (const char *region_name)
 
void vl_client_api_unmap (void)
 
void vl_set_memory_region_name (const char *name)
 
void vl_set_memory_root_path (const char *root_path)
 
void vl_set_memory_uid (int uid)
 
void vl_set_memory_gid (int gid)
 
void vl_set_global_memory_baseva (u64 baseva)
 
void vl_set_global_memory_size (u64 size)
 
void vl_set_api_memory_size (u64 size)
 
void vl_set_global_pvt_heap_size (u64 size)
 
void vl_set_api_pvt_heap_size (u64 size)
 
void vl_client_disconnect_from_vlib (void)
 
int vl_client_connect_to_vlib (const char *svm_name, const char *client_name, int rx_queue_size)
 
int vl_client_connect_to_vlib_no_rx_pthread (const char *svm_name, const char *client_name, int rx_queue_size)
 
int vl_client_connect_to_vlib_no_map (const char *svm_name, const char *client_name, int rx_queue_size)
 
u16 vl_client_get_first_plugin_msg_id (const char *plugin_name)
 
void vl_api_rpc_call_main_thread (void *fp, u8 *data, u32 data_length)
 
u32 vl_api_memclnt_create_internal (char *, unix_shared_memory_queue_t *)
 
void vl_init_shmem (svm_region_t *vlib_rp, int is_vlib, int is_private_region)
 
void vl_client_install_client_message_handlers (void)
 
void vl_api_send_pending_rpc_requests (vlib_main_t *vm)
 
void socksvr_add_pending_output (struct clib_file *uf, struct vl_api_registration_ *cf, u8 *buffer, uword buffer_bytes)
 
void vl_free_socket_registration_index (u32 pool_index)
 
void vl_socket_process_msg (struct clib_file *uf, struct vl_api_registration_ *rp, i8 *input_v)
 
clib_error_tvl_socket_read_ready (struct clib_file *uf)
 
void vl_socket_add_pending_output (struct clib_file *uf, struct vl_api_registration_ *rp, u8 *buffer, uword buffer_bytes)
 
void vl_socket_add_pending_output_no_flush (struct clib_file *uf, struct vl_api_registration_ *rp, u8 *buffer, uword buffer_bytes)
 
clib_error_tvl_socket_write_ready (struct clib_file *uf)
 
void vl_socket_api_send (vl_api_registration_t *rp, u8 *elem)
 
u32 sockclnt_open_index (char *client_name, char *hostname, int port)
 
void sockclnt_close_index (u32 index)
 
void vl_client_msg_api_send (vl_api_registration_t *cm, u8 *elem)
 
vl_api_registration_tsockclnt_get_registration (u32 index)
 
void vl_api_socket_process_msg (clib_file_t *uf, vl_api_registration_t *rp, i8 *input_v)
 
int vl_socket_client_connect (socket_client_main_t *scm, char *socket_path, char *client_name, u32 socket_buffer_size)
 
void vl_socket_client_read_reply (socket_client_main_t *scm)
 
void vl_socket_client_enable_disable (socket_client_main_t *scm, int enable)
 

Variables

vlib_node_registration_t memclnt_node
 (constructor) VLIB_REGISTER_NODE (memclnt_node) More...
 
volatile int ** vl_api_queue_cursizes
 
socket_main_t socket_main
 
socket_client_main_t socket_client_main
 

Macro Definition Documentation

#define API_SOCKET_FILE   "/run/vpp-api.sock"

Definition at line 146 of file api_common.h.

#define foreach_clnt_aring_size
Value:
_(1024+sizeof(ring_alloc_t), 1024) \
_(2048+sizeof(ring_alloc_t), 128) \
_(4096+sizeof(ring_alloc_t), 8)

Definition at line 55 of file api_common.h.

#define foreach_vl_aring_size
Value:
_(64+sizeof(ring_alloc_t), 1024) \
_(256+sizeof(ring_alloc_t), 128) \
_(1024+sizeof(ring_alloc_t), 64)

Definition at line 50 of file api_common.h.

#define QUEUE_SIGNAL_EVENT   1

Definition at line 143 of file api_common.h.

#define SOCKET_CLIENT_DEFAULT_BUFFER_SIZE   4096

Definition at line 204 of file api_common.h.

#define SOCKET_READ_EVENT   2

Definition at line 144 of file api_common.h.

#define VL_API_EPOCH_MASK   0xFF

Definition at line 90 of file api_common.h.

#define VL_API_EPOCH_SHIFT   8

Definition at line 91 of file api_common.h.

#define VL_SHM_VERSION   2

Definition at line 88 of file api_common.h.

Typedef Documentation

typedef struct ring_alloc_ ring_alloc_t
typedef struct vl_shmem_hdr_ vl_shmem_hdr_t

Function Documentation

void sockclnt_close_index ( u32  index)

Definition at line 151 of file sockclnt_vlib.c.

vl_api_registration_t* sockclnt_get_registration ( u32  index)

Definition at line 172 of file sockclnt_vlib.c.

u32 sockclnt_open_index ( char *  client_name,
char *  hostname,
int  port 
)

Definition at line 72 of file sockclnt_vlib.c.

void socksvr_add_pending_output ( struct clib_file uf,
struct vl_api_registration_ cf,
u8 buffer,
uword  buffer_bytes 
)
unix_shared_memory_queue_t* vl_api_client_index_to_input_queue ( u32  index)

Definition at line 700 of file memory_shared.c.

+ Here is the call graph for this function:

vl_api_registration_t* vl_api_client_index_to_registration ( u32  index)

Definition at line 691 of file memory_shared.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

u32 vl_api_memclnt_create_internal ( char *  ,
unix_shared_memory_queue_t  
)

Definition at line 142 of file memory_vlib.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void vl_api_rpc_call_main_thread ( void *  fp,
u8 data,
u32  data_length 
)

Definition at line 1916 of file memory_vlib.c.

+ Here is the caller graph for this function:

void vl_api_send_pending_rpc_requests ( vlib_main_t vm)

Definition at line 1428 of file main.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void vl_api_socket_process_msg ( clib_file_t uf,
vl_api_registration_t rp,
i8 input_v 
)

Definition at line 143 of file socksvr_vlib.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int vl_client_api_map ( const char *  region_name)

Definition at line 386 of file memory_client.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void vl_client_api_unmap ( void  )

Definition at line 398 of file memory_client.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int vl_client_connect ( const char *  name,
int  ctx_quota,
int  input_queue_size 
)

Definition at line 176 of file memory_client.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int vl_client_connect_to_vlib ( const char *  svm_name,
const char *  client_name,
int  rx_queue_size 
)

Definition at line 439 of file memory_client.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int vl_client_connect_to_vlib_no_map ( const char *  svm_name,
const char *  client_name,
int  rx_queue_size 
)

Definition at line 458 of file memory_client.c.

+ Here is the call graph for this function:

int vl_client_connect_to_vlib_no_rx_pthread ( const char *  svm_name,
const char *  client_name,
int  rx_queue_size 
)

Definition at line 448 of file memory_client.c.

+ Here is the call graph for this function:

void vl_client_disconnect ( void  )

Definition at line 283 of file memory_client.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void vl_client_disconnect_from_vlib ( void  )

Definition at line 467 of file memory_client.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

u16 vl_client_get_first_plugin_msg_id ( const char *  plugin_name)

Definition at line 500 of file memory_client.c.

+ Here is the call graph for this function:

void vl_client_install_client_message_handlers ( void  )

Definition at line 370 of file memory_client.c.

+ Here is the caller graph for this function:

void vl_client_msg_api_send ( vl_api_registration_t cm,
u8 elem 
)
void vl_free_socket_registration_index ( u32  pool_index)

Definition at line 119 of file socksvr_vlib.c.

+ Here is the caller graph for this function:

void vl_init_shmem ( svm_region_t vlib_rp,
int  is_vlib,
int  is_private_region 
)

Definition at line 368 of file memory_shared.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int vl_map_shmem ( const char *  region_name,
int  is_vlib 
)

Definition at line 445 of file memory_shared.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void* vl_msg_api_alloc ( int  nbytes)

Definition at line 199 of file memory_shared.c.

+ Here is the call graph for this function:

void* vl_msg_api_alloc_as_if_client ( int  nbytes)

Definition at line 224 of file memory_shared.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void* vl_msg_api_alloc_as_if_client_or_null ( int  nbytes)

Definition at line 230 of file memory_shared.c.

+ Here is the call graph for this function:

void* vl_msg_api_alloc_or_null ( int  nbytes)

Definition at line 213 of file memory_shared.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void vl_msg_api_free ( void *  a)

Definition at line 236 of file memory_shared.c.

+ Here is the call graph for this function:

void vl_msg_api_send ( vl_api_registration_t rp,
u8 elem 
)

Definition at line 102 of file memory_vlib.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void vl_msg_api_send_shmem ( unix_shared_memory_queue_t q,
u8 elem 
)

Definition at line 625 of file memory_shared.c.

+ Here is the call graph for this function:

void vl_msg_api_send_shmem_nolock ( unix_shared_memory_queue_t q,
u8 elem 
)

Definition at line 637 of file memory_shared.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void vl_register_mapped_shmem_region ( svm_region_t rp)

Definition at line 591 of file memory_shared.c.

void vl_set_api_memory_size ( u64  size)

Definition at line 344 of file memory_shared.c.

+ Here is the caller graph for this function:

void vl_set_api_pvt_heap_size ( u64  size)

Definition at line 360 of file memory_shared.c.

+ Here is the caller graph for this function:

void vl_set_global_memory_baseva ( u64  baseva)

Definition at line 328 of file memory_shared.c.

+ Here is the caller graph for this function:

void vl_set_global_memory_size ( u64  size)

Definition at line 336 of file memory_shared.c.

+ Here is the caller graph for this function:

void vl_set_global_pvt_heap_size ( u64  size)

Definition at line 352 of file memory_shared.c.

+ Here is the caller graph for this function:

void vl_set_memory_gid ( int  gid)

Definition at line 320 of file memory_shared.c.

+ Here is the caller graph for this function:

void vl_set_memory_region_name ( const char *  name)

Definition at line 1717 of file memory_vlib.c.

+ Here is the caller graph for this function:

void vl_set_memory_root_path ( const char *  root_path)

Definition at line 304 of file memory_shared.c.

+ Here is the caller graph for this function:

void vl_set_memory_uid ( int  uid)

Definition at line 312 of file memory_shared.c.

+ Here is the caller graph for this function:

void vl_socket_add_pending_output ( struct clib_file uf,
struct vl_api_registration_ rp,
u8 buffer,
uword  buffer_bytes 
)

Definition at line 269 of file socksvr_vlib.c.

void vl_socket_add_pending_output_no_flush ( struct clib_file uf,
struct vl_api_registration_ rp,
u8 buffer,
uword  buffer_bytes 
)

Definition at line 286 of file socksvr_vlib.c.

+ Here is the caller graph for this function:

void vl_socket_api_send ( vl_api_registration_t rp,
u8 elem 
)

Definition at line 79 of file socksvr_vlib.c.

int vl_socket_client_connect ( socket_client_main_t scm,
char *  socket_path,
char *  client_name,
u32  socket_buffer_size 
)

Definition at line 134 of file socket_client.c.

+ Here is the call graph for this function:

void vl_socket_client_enable_disable ( socket_client_main_t scm,
int  enable 
)

Definition at line 229 of file socket_client.c.

void vl_socket_client_read_reply ( socket_client_main_t scm)

Definition at line 75 of file socket_client.c.

+ Here is the call graph for this function:

void vl_socket_process_msg ( struct clib_file uf,
struct vl_api_registration_ rp,
i8 input_v 
)
clib_error_t* vl_socket_read_ready ( struct clib_file uf)

Definition at line 157 of file socksvr_vlib.c.

+ Here is the caller graph for this function:

clib_error_t* vl_socket_write_ready ( struct clib_file uf)

Definition at line 310 of file socksvr_vlib.c.

+ Here is the caller graph for this function:

void vl_unmap_shmem ( void  )

Definition at line 599 of file memory_shared.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Variable Documentation

(constructor) VLIB_REGISTER_NODE (memclnt_node)

Definition at line 1102 of file memory_vlib.c.

socket_client_main_t socket_client_main

Definition at line 64 of file socket_client.c.

socket_main_t socket_main

Definition at line 42 of file memory_shared.c.

volatile int** vl_api_queue_cursizes

Definition at line 1183 of file memory_vlib.c.