|
FD.io VPP
v21.10.1-2-g0a485f517
Vector Packet Processing
|
Go to the documentation of this file.
20 #ifndef included_api_common_h
21 #define included_api_common_h
79 #define VL_API_INVALID_FI ((u32)~0)
110 #define VL_API_LITTLE_ENDIAN 0x00
111 #define VL_API_BIG_ENDIAN 0x01
180 void *
print,
int msg_size,
int traced);
188 #ifdef BARRIER_TRACING
190 __attribute__ ((weak));
192 #define vl_msg_api_barrier_trace_context(X)
200 u16 msg_id_host_byte_order);
213 typedef struct _vl_msg_api_init_function_list_elt
215 struct _vl_msg_api_init_function_list_elt *next_init_function;
217 } _vl_msg_api_function_list_elt_t;
int replay_in_progress
Replay in progress?
void vl_msg_api_barrier_release(void)
svm_queue_t * q
message allocated in this shmem ring
u64 global_size
size of the global VM region
struct msgbuf_ msgbuf_t
Message header structure.
const char * root_path
Chroot path to the shared memory API files.
pthread_t rx_thread_handle
Bin API thread handle.
int traced
is this message to be traced?
void vl_msg_api_queue_handler(svm_queue_t *q)
u32 crc
message definition CRC
void * cleanup
non-default message cleanup handler
u8 * name
name of the plugin
u64 global_baseva
base virtual address for global VM region
char * name
the message name
#define CLIB_MEM_POISON(a, s)
@ REGISTRATION_TYPE_SOCKET_CLIENT
Socket client.
vl_registration_type_t
API registration types.
@ REGISTRATION_TYPE_SOCKET_LISTEN
Socket listener
svm_region_t ** vlib_private_rps
Vector of all mapped shared-VM segments.
void vl_msg_api_socket_handler(void *the_msg)
int size
for sanity checking
void(** msg_handlers)(void *)
Message handler vector
void vl_msg_api_config(vl_msg_api_msg_config_t *)
struct _svm_queue svm_queue_t
_vl_msg_api_function_list_elt_t * reaper_function_registrations
List of API client reaper functions.
Message configuration definition.
vl_registration_type_t registration_type
type
vl_api_registration_t * my_registration
This is the (shared VM) address of the registration, don't use it to id the connection since it can't...
vl_api_trace_t * rx_trace
Received message trace configuration.
u32 garbage_collects
Number of garbage-collected message buffers.
void * print
message print function
void vl_msg_api_set_first_available_msg_id(u16 first_avail)
svm_queue_t * vl_input_queue
shared memory only: pointer to client input queue
u32 data_len
message length not including header
vl_api_trace_which_t
Trace RX / TX enum.
struct ring_alloc_ * arings
Allocator ring vectors (in shared memory)
u8 * message_bounce
Don't automatically free message buffer vetor.
u16 vl_msg_api_get_msg_ids(const char *name, int n)
u16 last_msg_id
last assigned message ID
int vl_msg_api_pd_handler(void *mp, int rv)
__thread api_main_t * my_api_main
void * endian
message endian function
void vl_msg_api_replay_handler(void *the_msg)
api_version_t * api_version_list
api version list
u8 * is_autoendian
Message requires us to do endian conversion.
u32 unprocessed_msg_length
Socket only: unprocssed length.
svm_queue_t * vl_input_queue
Peer input queue pointer.
u64 api_pvt_heap_size
size of the api private mheap
int api_gid
gid for the api shared memory region
int message_bounce
do not free message after processing
void vl_msg_pop_heap_w_region(svm_region_t *vlib_rp, void *oldheap)
static CLIB_NOSANITIZE_ADDR void VL_MSG_API_UNPOISON(const void *a)
u8 enabled
trace is enabled
void vl_msg_api_post_mortem_dump(void)
u32 server_index
Socket client only: server index.
struct vl_api_registration_ vl_api_registration_t
An API client registration, only in vpp/vlib.
int(** pd_msg_handlers)(void *, int)
Plaform-dependent (aka hardware) message handler vector.
Trace configuration for a single message.
u64 global_pvt_heap_size
size of the global VM private mheap
const char * region_name
Shared VM binary API region name.
u8 endian
trace endianness
#define CLIB_NOSANITIZE_ADDR
void vl_msg_api_handler_no_trace_no_free(void *the_msg)
int * additional_fds_to_close
An API client registration, only in vpp/vlib.
void vl_msg_api_handler_no_free(void *the_msg)
elog_main_t * elog_main
event log
u32 missing_clients
Number of missing clients / failed message sends.
u8 * serialized_message_table_in_shmem
vlib/vpp only: serialized (message, name, crc) table
uword * msg_range_by_name
Message range by name hash.
int my_client_index
All VLIB-side message handlers use my_client_index to identify the queue / client.
struct vl_shmem_hdr_ * shmem_hdr
Binary API shared-memory segment header pointer.
uword * msg_index_by_name_and_crc
client message index hash table
static unsigned char * print(const cJSON *const item, cJSON_bool format, const internal_hooks *const hooks)
u8 data[0]
actual message begins here
int api_uid
uid for the api shared memory region
u32 clib_file_index
Socket only: file index.
static api_main_t * vlibapi_get_main(void)
vl_api_msg_range_t * msg_ranges
vector of message ranges
u32 vl_msg_api_get_msg_index(u8 *name_and_crc)
u32 vlib_input_queue_length
vpp/vlib input queue length
static void VL_MSG_API_POISON(const void *a)
trace_cfg_t * api_trace_cfg
Current trace configuration.
void vl_msg_api_trace_only(void *the_msg)
void(** msg_endian_handlers)(void *)
Message endian handler vector.
u32 curindex
Current index in circular buffer
const char ** msg_names
Message name vector.
void(** msg_print_handlers)(void *, void *)
Message print function vector.
void(** perf_counter_cbs_tmp)(struct api_main_t *, u32 id, int before_or_after)
vl_api_trace_t * tx_trace
Sent message trace configuration.
u16 first_available_msg_id
First available message ID, for theplugin msg allocator.
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)
API main structure, used by both vpp and binary API clients.
u64 api_size
size of the API region
svm_region_t * vlib_rp
Current binary api segment descriptor.
void vl_msg_api_clean_handlers(int msg_id)
u32 ring_misses
Number of times that the ring allocator failed.
void vl_msg_api_handler(void *the_msg)
u32 nitems
Number of trace records.
void vl_msg_api_free(void *)
u8 wrapped
trace has wrapped
void vl_noop_handler(void *mp)
#define vl_msg_api_barrier_trace_context(X)
void vl_msg_api_increment_missing_client_counter(void)
Message range (belonging to a plugin)
void * vl_msg_push_heap(void)
int replay
is this message to be replayed?
int trace_enable
trace this message
#define CLIB_MEM_UNPOISON(a, s)
void(** msg_cleanup_handlers)(void *)
non-default message cleanup handler vector
void * vl_msg_push_heap_w_region(svm_region_t *vlib_rp)
struct api_main_t api_main_t
API main structure, used by both vpp and binary API clients.
api_main_t api_global_main
u16 first_msg_id
first assigned message ID
u32 server_handle
Socket client only: server handle.
int replay_enable
This message can be replayed
void vl_msg_api_post_mortem_dump_enable_disable(int enable)
clib_error_t *() vl_msg_api_init_function_t(u32 client_index)
Message header structure.
u8 * output_vector
Socket only: output vector.
void(** perf_counter_cbs)(struct api_main_t *, u32 id, int before_or_after)
performance counter callback
void vl_msg_api_register_pd_handler(void *handler, u16 msg_id_host_byte_order)
int our_pid
Current process PID.
void vl_msg_api_cleanup_handler(void *the_msg)
static CLIB_NOSANITIZE_ADDR void VL_MSG_API_SVM_QUEUE_UNPOISON(const svm_queue_t *q)
vl_api_registration_t ** vl_clients
vlib/vpp only: vector of client registrations
svm_region_t ** mapped_shmem_regions
int is_autoendian
endian conversion required?
static void cleanup(void)
@ REGISTRATION_TYPE_SHMEM
Shared memory connection.
u32 gc_mark_timestamp
message garbage collector mark TS
svm_region_t * vlib_primary_rp
Primary api segment descriptor.
i8 * unprocessed_input
Socket only: pending input.
void vl_msg_api_set_cleanup_handler(int msg_id, void *fp)
void vl_msg_pop_heap(void *oldheap)
void * handler
the message handler
@ REGISTRATION_TYPE_SOCKET_SERVER
Socket server.
void vl_msg_api_barrier_sync(void)
int elog_trace_api_messages
static void vlibapi_set_main(api_main_t *am)
u8 * is_mp_safe
Message is mp safe vector.
int is_mp_safe
worker thread barrier required?
int msg_print_flag
Print every received message.
u32 vl_api_registration_pool_index
Index in VLIB's brain (not shared memory).
u8 * save_msg_table_filename
Dump (msg-name, crc) snapshot here at startup.