FD.io VPP  v21.06-3-gbb25fbf28
Vector Packet Processing
api.c File Reference
+ Include dependency graph for api.c:

Go to the source code of this file.

Macros

#define vl_typedefs   /* define message structures */
 
#define vl_endianfun   /* define message structures */
 
#define vl_print(handle, ...)   vlib_cli_output (handle, __VA_ARGS__)
 
#define vl_printfun
 
#define foreach_vpe_api_msg
 
#define QUOTE_(x)   #x
 
#define QUOTE(x)   QUOTE_(x)
 
#define BOUNCE_HANDLER(nn)
 
#define vl_msg_name_crc_list
 
#define vl_api_version_tuple(n, mj, mi, p)   vl_msg_api_add_version (am, #n, mj, mi, p);
 

Enumerations

enum  resolve_t { RESOLVE_IP4_ADD_DEL_ROUTE = 1, RESOLVE_IP6_ADD_DEL_ROUTE }
 

Functions

static clib_error_tmemclnt_delete_callback (u32 client_index)
 
 VL_MSG_API_REAPER_FUNCTION (memclnt_delete_callback)
 
static void vl_api_control_ping_t_handler (vl_api_control_ping_t *mp)
 
static void shmem_cli_output (uword arg, u8 *buffer, uword buffer_bytes)
 
static void vl_api_cli_t_handler (vl_api_cli_t *mp)
 
static void inband_cli_output (uword arg, u8 *buffer, uword buffer_bytes)
 
static void vl_api_cli_inband_t_handler (vl_api_cli_inband_t *mp)
 
static void vl_api_show_version_t_handler (vl_api_show_version_t *mp)
 
static void get_thread_data (vl_api_thread_data_t *td, int index)
 
static void vl_api_show_threads_t_handler (vl_api_show_threads_t *mp)
 
static void vl_api_get_node_index_t_handler (vl_api_get_node_index_t *mp)
 
static void vl_api_get_next_index_t_handler (vl_api_get_next_index_t *mp)
 
static void vl_api_add_node_next_t_handler (vl_api_add_node_next_t *mp)
 
static void vl_api_get_node_graph_t_handler (vl_api_get_node_graph_t *mp)
 
static void show_log_details (vl_api_registration_t *reg, u32 context, f64 timestamp, vl_api_log_level_t *level, u8 *msg_class, u8 *message)
 
static void vl_api_log_dump_t_handler (vl_api_log_dump_t *mp)
 
static void vl_api_show_vpe_system_time_t_handler (vl_api_show_vpe_system_time_t *mp)
 
static void vl_api_get_f64_endian_value_t_handler (vl_api_get_f64_endian_value_t *mp)
 
static void vl_api_get_f64_increment_by_one_t_handler (vl_api_get_f64_increment_by_one_t *mp)
 
static void setup_message_id_table (api_main_t *am)
 
static clib_error_tvpe_api_hookup (vlib_main_t *vm)
 
 VLIB_API_INIT_FUNCTION (vpe_api_hookup)
 
clib_error_tvpe_api_init (vlib_main_t *vm)
 
static clib_error_tapi_segment_config (vlib_main_t *vm, unformat_input_t *input)
 
void * get_unformat_vnet_sw_interface (void)
 

Variables

vpe_api_main_t vpe_api_main
 

Macro Definition Documentation

◆ BOUNCE_HANDLER

#define BOUNCE_HANDLER (   nn)
Value:
static void vl_api_##nn##_t_handler ( \
vl_api_##nn##_t *mp) \
{ \
vpe_client_registration_t *reg; \
vpe_api_main_t * vam = &vpe_api_main; \
svm_queue_t * q; \
\
/* One registration only... */ \
pool_foreach (reg, vam->nn##_registrations) \
({ \
q = vl_api_client_index_to_input_queue (reg->client_index); \
if (q) { \
/* \
* If the queue is stuffed, turf the msg and complain \
* It's unlikely that the intended recipient is \
* alive; avoid deadlock at all costs. \
*/ \
if (q->cursize == q->maxsize) { \
clib_warning ("ERROR: receiver queue full, drop msg"); \
vl_msg_api_free (mp); \
return; \
} \
vl_msg_api_send_shmem (q, (u8 *)&mp); \
return; \
} \
})); \
vl_msg_api_free (mp); \
}

Definition at line 576 of file api.c.

◆ foreach_vpe_api_msg

#define foreach_vpe_api_msg
Value:
_(CONTROL_PING, control_ping) \
_(CLI, cli) \
_(CLI_INBAND, cli_inband) \
_(GET_NODE_INDEX, get_node_index) \
_(ADD_NODE_NEXT, add_node_next) \
_(SHOW_VERSION, show_version) \
_(SHOW_THREADS, show_threads) \
_(GET_NODE_GRAPH, get_node_graph) \
_(GET_NEXT_INDEX, get_next_index) \
_(LOG_DUMP, log_dump) \
_(SHOW_VPE_SYSTEM_TIME, show_vpe_system_time) \
_(GET_F64_ENDIAN_VALUE, get_f64_endian_value) \
_(GET_F64_INCREMENT_BY_ONE, get_f64_increment_by_one) \

Definition at line 77 of file api.c.

◆ QUOTE

#define QUOTE (   x)    QUOTE_(x)

Definition at line 93 of file api.c.

◆ QUOTE_

#define QUOTE_ (   x)    #x

Definition at line 92 of file api.c.

◆ vl_api_version_tuple

#define vl_api_version_tuple (   n,
  mj,
  mi,
 
)    vl_msg_api_add_version (am, #n, mj, mi, p);

◆ vl_endianfun

#define vl_endianfun   /* define message structures */

Definition at line 67 of file api.c.

◆ vl_msg_name_crc_list

#define vl_msg_name_crc_list

Definition at line 794 of file api.c.

◆ vl_print

#define vl_print (   handle,
  ... 
)    vlib_cli_output (handle, __VA_ARGS__)

Definition at line 71 of file api.c.

◆ vl_printfun

#define vl_printfun

Definition at line 72 of file api.c.

◆ vl_typedefs

#define vl_typedefs   /* define message structures */

Definition at line 64 of file api.c.

Enumeration Type Documentation

◆ resolve_t

enum resolve_t
Enumerator
RESOLVE_IP4_ADD_DEL_ROUTE 
RESOLVE_IP6_ADD_DEL_ROUTE 

Definition at line 95 of file api.c.

Function Documentation

◆ api_segment_config()

static clib_error_t* api_segment_config ( vlib_main_t vm,
unformat_input_t input 
)
static

Definition at line 670 of file api.c.

◆ get_thread_data()

static void get_thread_data ( vl_api_thread_data_t *  td,
int  index 
)
static

Definition at line 265 of file api.c.

+ Here is the caller graph for this function:

◆ get_unformat_vnet_sw_interface()

void* get_unformat_vnet_sw_interface ( void  )

Definition at line 789 of file api.c.

◆ inband_cli_output()

static void inband_cli_output ( uword  arg,
u8 buffer,
uword  buffer_bytes 
)
static

Definition at line 195 of file api.c.

+ Here is the caller graph for this function:

◆ memclnt_delete_callback()

static clib_error_t* memclnt_delete_callback ( u32  client_index)
static

Definition at line 105 of file api.c.

◆ setup_message_id_table()

static void setup_message_id_table ( api_main_t am)
static

Definition at line 799 of file api.c.

+ Here is the caller graph for this function:

◆ shmem_cli_output()

static void shmem_cli_output ( uword  arg,
u8 buffer,
uword  buffer_bytes 
)
static

Definition at line 140 of file api.c.

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

◆ show_log_details()

static void show_log_details ( vl_api_registration_t reg,
u32  context,
f64  timestamp,
vl_api_log_level_t *  level,
u8 msg_class,
u8 message 
)
static

Definition at line 467 of file api.c.

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

◆ vl_api_add_node_next_t_handler()

static void vl_api_add_node_next_t_handler ( vl_api_add_node_next_t mp)
static

Definition at line 398 of file api.c.

+ Here is the call graph for this function:

◆ vl_api_cli_inband_t_handler()

static void vl_api_cli_inband_t_handler ( vl_api_cli_inband_t mp)
static

Definition at line 207 of file api.c.

+ Here is the call graph for this function:

◆ vl_api_cli_t_handler()

static void vl_api_cli_t_handler ( vl_api_cli_t mp)
static

Definition at line 164 of file api.c.

+ Here is the call graph for this function:

◆ vl_api_control_ping_t_handler()

static void vl_api_control_ping_t_handler ( vl_api_control_ping_t mp)
static

Definition at line 126 of file api.c.

◆ vl_api_get_f64_endian_value_t_handler()

static void vl_api_get_f64_endian_value_t_handler ( vl_api_get_f64_endian_value_t mp)
static

Definition at line 545 of file api.c.

+ Here is the call graph for this function:

◆ vl_api_get_f64_increment_by_one_t_handler()

static void vl_api_get_f64_increment_by_one_t_handler ( vl_api_get_f64_increment_by_one_t mp)
static

Definition at line 562 of file api.c.

+ Here is the call graph for this function:

◆ vl_api_get_next_index_t_handler()

static void vl_api_get_next_index_t_handler ( vl_api_get_next_index_t mp)
static

Definition at line 351 of file api.c.

+ Here is the call graph for this function:

◆ vl_api_get_node_graph_t_handler()

static void vl_api_get_node_graph_t_handler ( vl_api_get_node_graph_t mp)
static

Definition at line 431 of file api.c.

+ Here is the call graph for this function:

◆ vl_api_get_node_index_t_handler()

static void vl_api_get_node_index_t_handler ( vl_api_get_node_index_t mp)
static

Definition at line 327 of file api.c.

+ Here is the call graph for this function:

◆ vl_api_log_dump_t_handler()

static void vl_api_log_dump_t_handler ( vl_api_log_dump_t mp)
static

Definition at line 498 of file api.c.

+ Here is the call graph for this function:

◆ vl_api_show_threads_t_handler()

static void vl_api_show_threads_t_handler ( vl_api_show_threads_t mp)
static

Definition at line 281 of file api.c.

+ Here is the call graph for this function:

◆ vl_api_show_version_t_handler()

static void vl_api_show_version_t_handler ( vl_api_show_version_t mp)
static

Definition at line 242 of file api.c.

+ Here is the call graph for this function:

◆ vl_api_show_vpe_system_time_t_handler()

static void vl_api_show_vpe_system_time_t_handler ( vl_api_show_vpe_system_time_t mp)
static

Definition at line 532 of file api.c.

+ Here is the call graph for this function:

◆ VL_MSG_API_REAPER_FUNCTION()

VL_MSG_API_REAPER_FUNCTION ( memclnt_delete_callback  )

◆ VLIB_API_INIT_FUNCTION()

VLIB_API_INIT_FUNCTION ( vpe_api_hookup  )

◆ vpe_api_hookup()

static clib_error_t* vpe_api_hookup ( vlib_main_t vm)
static

Definition at line 612 of file api.c.

+ Here is the call graph for this function:

◆ vpe_api_init()

clib_error_t* vpe_api_init ( vlib_main_t vm)

Definition at line 652 of file api.c.

+ Here is the caller graph for this function:

Variable Documentation

◆ vpe_api_main

vpe_api_main_t vpe_api_main

Definition at line 55 of file interface_api.c.

vpe_api_main
vpe_api_main_t vpe_api_main
Definition: interface_api.c:55
vl_api_client_index_to_input_queue
svm_queue_t * vl_api_client_index_to_input_queue(u32 index)
Definition: memory_api.c:794
u8
unsigned char u8
Definition: types.h:56