20 #ifndef included_api_common_h 21 #define included_api_common_h 97 #define VL_API_LITTLE_ENDIAN 0x00 98 #define VL_API_BIG_ENDIAN 0x01 146 void *print,
int msg_size,
int traced);
154 #ifdef BARRIER_TRACING 156 __attribute__ ((weak));
158 #define vl_msg_api_barrier_trace_context(X) 166 u16 msg_id_host_byte_order);
175 typedef struct _vl_msg_api_init_function_list_elt
177 struct _vl_msg_api_init_function_list_elt *next_init_function;
179 } _vl_msg_api_function_list_elt_t;
185 void (**msg_handlers) (
void *);
187 int (**pd_msg_handlers) (
void *, int);
190 void (**msg_cleanup_handlers) (
void *);
193 void (**msg_endian_handlers) (
void *);
196 void (**msg_print_handlers) (
void *,
void *);
Message range (belonging to a plugin)
void vl_msg_api_config(vl_msg_api_msg_config_t *)
u64 api_pvt_heap_size
size of the api private mheap
u16 vl_msg_api_get_msg_ids(const char *name, int n)
u8 * name
name of the plugin
struct msgbuf_ msgbuf_t
Message header structure.
void * print
message print function
u64 api_size
size of the API region
u8 wrapped
trace has wrapped
int size
for sanity checking
int my_client_index
All VLIB-side message handlers use my_client_index to identify the queue / client.
u32 crc
message definition CRC
u8 * message_bounce
Don't automatically free message buffer vetor.
Message configuration definition.
u32 gc_mark_timestamp
message garbage collector mark TS
int api_uid
uid for the api shared memory region
u32 server_index
Socket client only: server index.
int api_gid
gid for the api shared memory region
void * cleanup
non-default message cleanup handler
trace_cfg_t * api_trace_cfg
Current trace configuration.
unix_shared_memory_queue_t * vl_input_queue
Peer input queue pointer.
_vl_msg_api_function_list_elt_t * reaper_function_registrations
List of API client reaper functions.
int our_pid
Current process PID.
u32 clib_file_index
Socket only: file index.
void vl_msg_api_set_cleanup_handler(int msg_id, void *fp)
void * endian
message endian function
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.
void vl_msg_api_handler_no_trace_no_free(void *the_msg)
u32 ring_misses
Number of times that the ring allocator failed.
#define vl_msg_api_barrier_trace_context(X)
vl_api_registration_t ** vl_clients
vlib/vpp only: vector of client registrations
int replay_in_progress
Replay in progress?
const char * root_path
Chroot path to the shared memory API files.
svm_region_t * vlib_rp
Binary api segment descriptor.
struct vl_shmem_hdr_ * shmem_hdr
Binary API shared-memory segment header pointer.
void vl_msg_api_set_first_available_msg_id(u16 first_avail)
void vl_msg_api_post_mortem_dump(void)
u32 vl_api_get_msg_index(u8 *name_and_crc)
vl_registration_type_t registration_type
type
u16 last_msg_id
last assigned message ID
struct vl_api_registration_ vl_api_registration_t
An API client registration, only in vpp/vlib.
int replay_enable
This message can be replayed.
void vl_msg_api_free(void *)
int message_bounce
do not free message after processing
void vl_msg_api_handler(void *the_msg)
u32 curindex
Current index in circular buffer.
static void cleanup(void)
void vl_msg_api_trace_only(void *the_msg)
void vl_msg_api_barrier_sync(void)
u32 unprocessed_msg_length
Socket only: unprocssed length.
void vl_msg_api_clean_handlers(int msg_id)
void vl_msg_api_socket_handler(void *the_msg)
API main structure, used by both vpp and binary API clients.
u64 global_size
size of the global VM region
u8 enabled
trace is enabled
An API client registration, only in vpp/vlib.
vl_registration_type_t
API registration types.
void vl_msg_api_handler_no_free(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)
u64 global_baseva
base virtual address for global VM region
unix_shared_memory_queue_t * vl_input_queue
shared memory only: pointer to client input queue
unix_shared_memory_queue_t * q
message allocated in this shmem ring
vl_api_msg_range_t * msg_ranges
vector of message ranges
u8 * output_vector
Socket only: output vecto.
void vl_noop_handler(void *mp)
int vl_msg_api_pd_handler(void *mp, int rv)
const char ** msg_names
Message name vector.
void vl_msg_api_barrier_release(void)
int replay
is this message to be replayed?
u8 * save_msg_table_filename
Dump (msg-name, crc) snapshot here at startup.
void vl_msg_api_increment_missing_client_counter(void)
vl_api_trace_t * tx_trace
Sent message trace configuration.
u32 garbage_collects
Number of garbage-collected message buffers.
u32 data_len
message length not including header
Message header structure.
u8 * serialized_message_table_in_shmem
vlib/vpp only: serialized (message, name, crc) table
u64 global_pvt_heap_size
size of the global VM private mheap
i8 * unprocessed_input
Socket only: pending input.
struct ring_alloc_ * arings
Allocator ring vectors (in shared memory)
i32 vlib_signal
(Historical) signal-based queue non-empty signal, to be removed
u32 missing_clients
Number of missing clients / failed message sends.
void vl_msg_api_post_mortem_dump_enable_disable(int enable)
u16 first_msg_id
first assigned message ID
u32 vl_api_registration_pool_index
Index in VLIB's brain (not shared memory).
void vl_msg_api_register_pd_handler(void *handler, u16 msg_id_host_byte_order)
void vl_msg_api_queue_handler(unix_shared_memory_queue_t *q)
u16 first_available_msg_id
First available message ID, for theplugin msg allocator.
u8 endian
trace endianness
u8 * is_mp_safe
Message is mp safe vector.
int trace_enable
trace this message
int msg_print_flag
Print every received message.
u32 server_handle
Socket client only: server handle.
void vl_msg_api_replay_handler(void *the_msg)
void vl_msg_api_cleanup_handler(void *the_msg)
int is_mp_safe
worker thread barrier required?
int traced
is this message to be traced?
vl_api_trace_which_t
Trace RX / TX enum.
const char * region_name
Shared VM binary API region name.
Trace configuration for a single message.
svm_region_t ** mapped_shmem_regions
Vector of all mapped shared-VM segments.
uword * msg_index_by_name_and_crc
client message index hash table
uword * msg_range_by_name
Message range by name hash.
Shared memory connection.
char * name
the message name
u32 nitems
Number of trace records.
void * handler
the message handler
u32 vlib_input_queue_length
vpp/vlib input queue length
clib_error_t *( vl_msg_api_init_function_t)(u32 client_index)
struct _unix_shared_memory_queue unix_shared_memory_queue_t