FD.io VPP  v20.09-64-g4f7b92f0a
Vector Packet Processing
api_common.h File Reference

API common definitions See api_doc.md for more info. More...

+ 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  vl_api_registration_
 An API client registration, only in vpp/vlib. More...
 
struct  trace_cfg_t
 Trace configuration for a single message. More...
 
struct  vl_api_trace_t
 API trace state. More...
 
struct  vl_api_msg_range_t
 Message range (belonging to a plugin) More...
 
struct  vl_msg_api_msg_config_t
 Message configuration definition. More...
 
struct  msgbuf_
 Message header structure. More...
 
struct  api_version_t
 
struct  api_main_t
 API main structure, used by both vpp and binary API clients. More...
 

Macros

#define VL_API_INVALID_FI   ((u32)~0)
 
#define VL_API_LITTLE_ENDIAN   0x00
 
#define VL_API_BIG_ENDIAN   0x01
 
#define vl_msg_api_barrier_trace_context(X)
 

Typedefs

typedef struct vl_api_registration_ vl_api_registration_t
 An API client registration, only in vpp/vlib. More...
 
typedef struct msgbuf_ msgbuf_t
 Message header structure. More...
 
typedef clib_error_t *() vl_msg_api_init_function_t(u32 client_index)
 
typedef struct api_main_t api_main_t
 API main structure, used by both vpp and binary API clients. More...
 

Enumerations

enum  vl_registration_type_t {
  REGISTRATION_TYPE_FREE = 0, REGISTRATION_TYPE_SHMEM, REGISTRATION_TYPE_SOCKET_LISTEN, REGISTRATION_TYPE_SOCKET_SERVER,
  REGISTRATION_TYPE_SOCKET_CLIENT
}
 API registration types. More...
 
enum  vl_api_trace_which_t { VL_API_TRACE_TX, VL_API_TRACE_RX }
 Trace RX / TX enum. More...
 

Functions

static CLIB_NOSANITIZE_ADDR void VL_MSG_API_UNPOISON (const void *a)
 
static CLIB_NOSANITIZE_ADDR void VL_MSG_API_SVM_QUEUE_UNPOISON (const svm_queue_t *q)
 
static void VL_MSG_API_POISON (const void *a)
 
void vl_msg_api_handler (void *the_msg)
 
void vl_msg_api_handler_no_free (void *the_msg)
 
void vl_msg_api_handler_no_trace_no_free (void *the_msg)
 
void vl_msg_api_trace_only (void *the_msg)
 
void vl_msg_api_cleanup_handler (void *the_msg)
 
void vl_msg_api_replay_handler (void *the_msg)
 
void vl_msg_api_socket_handler (void *the_msg)
 
void vl_msg_api_set_handlers (int msg_id, char *msg_name, void *handler, void *cleanup, void *endian, void *print, int msg_size, int traced)
 
void vl_msg_api_clean_handlers (int msg_id)
 
void vl_msg_api_config (vl_msg_api_msg_config_t *)
 
void vl_msg_api_set_cleanup_handler (int msg_id, void *fp)
 
void vl_msg_api_queue_handler (svm_queue_t *q)
 
void vl_msg_api_barrier_sync (void)
 
void vl_msg_api_barrier_release (void)
 
void vl_msg_api_free (void *)
 
void vl_noop_handler (void *mp)
 
void vl_msg_api_increment_missing_client_counter (void)
 
void vl_msg_api_post_mortem_dump (void)
 
void vl_msg_api_post_mortem_dump_enable_disable (int enable)
 
void vl_msg_api_register_pd_handler (void *handler, u16 msg_id_host_byte_order)
 
int vl_msg_api_pd_handler (void *mp, int rv)
 
void vl_msg_api_set_first_available_msg_id (u16 first_avail)
 
u16 vl_msg_api_get_msg_ids (const char *name, int n)
 
u32 vl_msg_api_get_msg_index (u8 *name_and_crc)
 
void * vl_msg_push_heap (void)
 
void * vl_msg_push_heap_w_region (svm_region_t *vlib_rp)
 
void vl_msg_pop_heap (void *oldheap)
 
void vl_msg_pop_heap_w_region (svm_region_t *vlib_rp, void *oldheap)
 
static api_main_tvlibapi_get_main (void)
 
static void vlibapi_set_main (api_main_t *am)
 

Variables

__thread api_main_tmy_api_main
 
api_main_t api_global_main
 

Detailed Description

API common definitions See api_doc.md for more info.

Definition in file api_common.h.

Macro Definition Documentation

◆ VL_API_BIG_ENDIAN

#define VL_API_BIG_ENDIAN   0x01

Definition at line 110 of file api_common.h.

◆ VL_API_INVALID_FI

#define VL_API_INVALID_FI   ((u32)~0)

Definition at line 78 of file api_common.h.

◆ VL_API_LITTLE_ENDIAN

#define VL_API_LITTLE_ENDIAN   0x00

Definition at line 109 of file api_common.h.

◆ vl_msg_api_barrier_trace_context

#define vl_msg_api_barrier_trace_context (   X)

Definition at line 191 of file api_common.h.

Typedef Documentation

◆ api_main_t

typedef struct api_main_t api_main_t

API main structure, used by both vpp and binary API clients.

◆ msgbuf_t

typedef struct msgbuf_ msgbuf_t

Message header structure.

◆ vl_api_registration_t

An API client registration, only in vpp/vlib.

◆ vl_msg_api_init_function_t

typedef clib_error_t*() vl_msg_api_init_function_t(u32 client_index)

Definition at line 210 of file api_common.h.

Enumeration Type Documentation

◆ vl_api_trace_which_t

Trace RX / TX enum.

Enumerator
VL_API_TRACE_TX 
VL_API_TRACE_RX 

Definition at line 103 of file api_common.h.

◆ vl_registration_type_t

API registration types.

Enumerator
REGISTRATION_TYPE_FREE 
REGISTRATION_TYPE_SHMEM 

Shared memory connection.

REGISTRATION_TYPE_SOCKET_LISTEN 

Socket listener.

REGISTRATION_TYPE_SOCKET_SERVER 

Socket server.

REGISTRATION_TYPE_SOCKET_CLIENT 

Socket client.

Definition at line 36 of file api_common.h.

Function Documentation

◆ vl_msg_api_barrier_release()

void vl_msg_api_barrier_release ( void  )

Definition at line 432 of file api_shared.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vl_msg_api_barrier_sync()

void vl_msg_api_barrier_sync ( void  )

Definition at line 427 of file api_shared.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vl_msg_api_clean_handlers()

void vl_msg_api_clean_handlers ( int  msg_id)

Definition at line 881 of file api_shared.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vl_msg_api_cleanup_handler()

void vl_msg_api_cleanup_handler ( void *  the_msg)

Definition at line 739 of file api_shared.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vl_msg_api_config()

void vl_msg_api_config ( vl_msg_api_msg_config_t )

Definition at line 808 of file api_shared.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vl_msg_api_free()

void vl_msg_api_free ( void *  )

Definition at line 311 of file memory_shared.c.

+ Here is the caller graph for this function:

◆ vl_msg_api_get_msg_ids()

u16 vl_msg_api_get_msg_ids ( const char *  name,
int  n 
)

Definition at line 1033 of file api_shared.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vl_msg_api_get_msg_index()

u32 vl_msg_api_get_msg_index ( u8 name_and_crc)

Definition at line 1105 of file api_shared.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vl_msg_api_handler()

void vl_msg_api_handler ( void *  the_msg)

Definition at line 690 of file api_shared.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vl_msg_api_handler_no_free()

void vl_msg_api_handler_no_free ( void *  the_msg)

Definition at line 410 of file threads.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vl_msg_api_handler_no_trace_no_free()

void vl_msg_api_handler_no_trace_no_free ( void *  the_msg)

Definition at line 711 of file api_shared.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vl_msg_api_increment_missing_client_counter()

void vl_msg_api_increment_missing_client_counter ( void  )

Definition at line 55 of file api_shared.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vl_msg_api_pd_handler()

int vl_msg_api_pd_handler ( void *  mp,
int  rv 
)

Definition at line 1004 of file api_shared.c.

+ Here is the call graph for this function:

◆ VL_MSG_API_POISON()

static void VL_MSG_API_POISON ( const void *  a)
inlinestatic

Definition at line 161 of file api_common.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vl_msg_api_post_mortem_dump()

void vl_msg_api_post_mortem_dump ( void  )

Definition at line 955 of file api_shared.c.

◆ vl_msg_api_post_mortem_dump_enable_disable()

void vl_msg_api_post_mortem_dump_enable_disable ( int  enable)

Definition at line 949 of file api_shared.c.

+ Here is the caller graph for this function:

◆ vl_msg_api_queue_handler()

void vl_msg_api_queue_handler ( svm_queue_t q)

Definition at line 903 of file api_shared.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vl_msg_api_register_pd_handler()

void vl_msg_api_register_pd_handler ( void *  handler,
u16  msg_id_host_byte_order 
)

Definition at line 990 of file api_shared.c.

+ Here is the call graph for this function:

◆ vl_msg_api_replay_handler()

void vl_msg_api_replay_handler ( void *  the_msg)

Definition at line 759 of file api_shared.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vl_msg_api_set_cleanup_handler()

void vl_msg_api_set_cleanup_handler ( int  msg_id,
void *  fp 
)

Definition at line 893 of file api_shared.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vl_msg_api_set_first_available_msg_id()

void vl_msg_api_set_first_available_msg_id ( u16  first_avail)

Definition at line 1025 of file api_shared.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vl_msg_api_set_handlers()

void vl_msg_api_set_handlers ( int  msg_id,
char *  msg_name,
void *  handler,
void *  cleanup,
void *  endian,
void *  print,
int  msg_size,
int  traced 
)

Definition at line 858 of file api_shared.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vl_msg_api_socket_handler()

void vl_msg_api_socket_handler ( void *  the_msg)

Definition at line 786 of file api_shared.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ VL_MSG_API_SVM_QUEUE_UNPOISON()

static CLIB_NOSANITIZE_ADDR void VL_MSG_API_SVM_QUEUE_UNPOISON ( const svm_queue_t q)
inlinestatic

Definition at line 155 of file api_common.h.

+ Here is the caller graph for this function:

◆ vl_msg_api_trace_only()

void vl_msg_api_trace_only ( void *  the_msg)

Definition at line 728 of file api_shared.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ VL_MSG_API_UNPOISON()

static CLIB_NOSANITIZE_ADDR void VL_MSG_API_UNPOISON ( const void *  a)
inlinestatic

Definition at line 148 of file api_common.h.

+ Here is the caller graph for this function:

◆ vl_msg_pop_heap()

void vl_msg_pop_heap ( void *  oldheap)

Definition at line 727 of file cli.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vl_msg_pop_heap_w_region()

void vl_msg_pop_heap_w_region ( svm_region_t vlib_rp,
void *  oldheap 
)

Definition at line 1134 of file api_shared.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vl_msg_push_heap()

void * vl_msg_push_heap ( void  )

Definition at line 720 of file cli.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vl_msg_push_heap_w_region()

void* vl_msg_push_heap_w_region ( svm_region_t vlib_rp)

Definition at line 1120 of file api_shared.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vl_noop_handler()

void vl_noop_handler ( void *  mp)

Definition at line 941 of file api_shared.c.

+ Here is the caller graph for this function:

◆ vlibapi_get_main()

static api_main_t* vlibapi_get_main ( void  )
inlinestatic

Definition at line 389 of file api_common.h.

◆ vlibapi_set_main()

static void vlibapi_set_main ( api_main_t am)
inlinestatic

Definition at line 395 of file api_common.h.

+ Here is the caller graph for this function:

Variable Documentation

◆ api_global_main

api_main_t api_global_main

Definition at line 36 of file api_shared.c.

◆ my_api_main

__thread api_main_t* my_api_main

Definition at line 45 of file api_shared.c.