FD.io VPP  v21.06-3-gbb25fbf28
Vector Packet Processing
session_api.c File Reference
+ Include dependency graph for session_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_session_api_msg
 
#define vl_msg_name_crc_list
 

Functions

static transport_proto_t api_session_transport_proto_decode (const vl_api_transport_proto_t *api_tp)
 
static vl_api_transport_proto_t api_session_transport_proto_encode (const transport_proto_t tp)
 
static int session_send_fds (vl_api_registration_t *reg, int fds[], int n_fds)
 
static int mq_try_lock_and_alloc_msg (svm_msg_q_t *app_mq, svm_msg_q_msg_t *msg)
 
static int mq_send_session_accepted_cb (session_t *s)
 
static void mq_send_session_close_evt (app_worker_t *app_wrk, session_handle_t sh, session_evt_type_t evt_type)
 
static void mq_notify_close_subscribers (u32 app_index, session_handle_t sh, svm_fifo_t *f, session_evt_type_t evt_type)
 
static void mq_send_session_disconnected_cb (session_t *s)
 
static void mq_send_session_reset_cb (session_t *s)
 
int mq_send_session_connected_cb (u32 app_wrk_index, u32 api_context, session_t *s, session_error_t err)
 
int mq_send_session_bound_cb (u32 app_wrk_index, u32 api_context, session_handle_t handle, int rv)
 
void mq_send_unlisten_reply (app_worker_t *app_wrk, session_handle_t sh, u32 context, int rv)
 
static void mq_send_session_migrate_cb (session_t *s, session_handle_t new_sh)
 
static int mq_send_add_segment_cb (u32 app_wrk_index, u64 segment_handle)
 
static int mq_send_del_segment_cb (u32 app_wrk_index, u64 segment_handle)
 
static void mq_send_session_cleanup_cb (session_t *s, session_cleanup_ntf_t ntf)
 
static void vl_api_session_enable_disable_t_handler (vl_api_session_enable_disable_t *mp)
 
static void vl_api_app_attach_t_handler (vl_api_app_attach_t *mp)
 
static void vl_api_app_worker_add_del_t_handler (vl_api_app_worker_add_del_t *mp)
 
static void vl_api_application_detach_t_handler (vl_api_application_detach_t *mp)
 
static void vl_api_app_namespace_add_del_t_handler (vl_api_app_namespace_add_del_t *mp)
 
static void vl_api_session_rule_add_del_t_handler (vl_api_session_rule_add_del_t *mp)
 
static void send_session_rule_details4 (mma_rule_16_t *rule, u8 is_local, u8 transport_proto, u32 appns_index, u8 *tag, vl_api_registration_t *reg, u32 context)
 
static void send_session_rule_details6 (mma_rule_40_t *rule, u8 is_local, u8 transport_proto, u32 appns_index, u8 *tag, vl_api_registration_t *reg, u32 context)
 
static void send_session_rules_table_details (session_rules_table_t *srt, u8 fib_proto, u8 tp, u8 is_local, u32 appns_index, vl_api_registration_t *reg, u32 context)
 
static void vl_api_session_rules_dump_t_handler (vl_api_session_rules_dump_t *mp)
 
static void vl_api_app_add_cert_key_pair_t_handler (vl_api_app_add_cert_key_pair_t *mp)
 
static void vl_api_app_del_cert_key_pair_t_handler (vl_api_app_del_cert_key_pair_t *mp)
 
static clib_error_tapplication_reaper_cb (u32 client_index)
 
 VL_MSG_API_REAPER_FUNCTION (application_reaper_cb)
 
static void setup_message_id_table (api_main_t *am)
 
static clib_error_tsession_api_hookup (vlib_main_t *vm)
 
 VLIB_API_INIT_FUNCTION (session_api_hookup)
 
static void sapi_send_fds (app_worker_t *app_wrk, int *fds, int n_fds)
 
static int mq_send_add_segment_sapi_cb (u32 app_wrk_index, u64 segment_handle)
 
static int mq_send_del_segment_sapi_cb (u32 app_wrk_index, u64 segment_handle)
 
static void session_api_attach_handler (app_namespace_t *app_ns, clib_socket_t *cs, app_sapi_attach_msg_t *mp)
 
static void sapi_socket_close_w_handle (u32 api_handle)
 
static void sapi_add_del_worker_handler (app_namespace_t *app_ns, clib_socket_t *cs, app_sapi_worker_add_del_msg_t *mp)
 
static void sapi_socket_detach (app_namespace_t *app_ns, clib_socket_t *cs)
 
static clib_error_tsapi_sock_read_ready (clib_file_t *cf)
 
static clib_error_tsapi_sock_write_ready (clib_file_t *cf)
 
static clib_error_tsapi_sock_error (clib_file_t *cf)
 
static clib_error_tsapi_sock_accept_ready (clib_file_t *scf)
 
int appns_sapi_add_ns_socket (app_namespace_t *app_ns)
 

Variables

static session_cb_vft_t session_mq_cb_vft
 
static session_cb_vft_t session_mq_sapi_cb_vft
 

Macro Definition Documentation

◆ foreach_session_api_msg

#define foreach_session_api_msg
Value:
_(APP_ATTACH, app_attach) \
_(APPLICATION_DETACH, application_detach) \
_(SESSION_ENABLE_DISABLE, session_enable_disable) \
_(APP_NAMESPACE_ADD_DEL, app_namespace_add_del) \
_(SESSION_RULE_ADD_DEL, session_rule_add_del) \
_(SESSION_RULES_DUMP, session_rules_dump) \
_(APP_ADD_CERT_KEY_PAIR, app_add_cert_key_pair) \
_(APP_DEL_CERT_KEY_PAIR, app_del_cert_key_pair) \
_(APP_WORKER_ADD_DEL, app_worker_add_del) \

Definition at line 45 of file session_api.c.

◆ vl_endianfun

#define vl_endianfun   /* define message structures */

Definition at line 33 of file session_api.c.

◆ vl_msg_name_crc_list

#define vl_msg_name_crc_list

Definition at line 1141 of file session_api.c.

◆ vl_print

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

Definition at line 38 of file session_api.c.

◆ vl_printfun

#define vl_printfun

Definition at line 39 of file session_api.c.

◆ vl_typedefs

#define vl_typedefs   /* define message structures */

Definition at line 29 of file session_api.c.

Function Documentation

◆ api_session_transport_proto_decode()

static transport_proto_t api_session_transport_proto_decode ( const vl_api_transport_proto_t *  api_tp)
static

Definition at line 57 of file session_api.c.

+ Here is the caller graph for this function:

◆ api_session_transport_proto_encode()

static vl_api_transport_proto_t api_session_transport_proto_encode ( const transport_proto_t  tp)
static

Definition at line 75 of file session_api.c.

+ Here is the caller graph for this function:

◆ application_reaper_cb()

static clib_error_t* application_reaper_cb ( u32  client_index)
static

Definition at line 1126 of file session_api.c.

+ Here is the call graph for this function:

◆ appns_sapi_add_ns_socket()

int appns_sapi_add_ns_socket ( app_namespace_t app_ns)

Definition at line 1648 of file session_api.c.

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

◆ mq_notify_close_subscribers()

static void mq_notify_close_subscribers ( u32  app_index,
session_handle_t  sh,
svm_fifo_t f,
session_evt_type_t  evt_type 
)
inlinestatic

Definition at line 219 of file session_api.c.

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

◆ mq_send_add_segment_cb()

static int mq_send_add_segment_cb ( u32  app_wrk_index,
u64  segment_handle 
)
static

Definition at line 471 of file session_api.c.

+ Here is the call graph for this function:

◆ mq_send_add_segment_sapi_cb()

static int mq_send_add_segment_sapi_cb ( u32  app_wrk_index,
u64  segment_handle 
)
static

Definition at line 1211 of file session_api.c.

+ Here is the call graph for this function:

◆ mq_send_del_segment_cb()

static int mq_send_del_segment_cb ( u32  app_wrk_index,
u64  segment_handle 
)
static

Definition at line 533 of file session_api.c.

+ Here is the call graph for this function:

◆ mq_send_del_segment_sapi_cb()

static int mq_send_del_segment_sapi_cb ( u32  app_wrk_index,
u64  segment_handle 
)
static

Definition at line 1262 of file session_api.c.

+ Here is the call graph for this function:

◆ mq_send_session_accepted_cb()

static int mq_send_session_accepted_cb ( session_t s)
static

Definition at line 127 of file session_api.c.

+ Here is the call graph for this function:

◆ mq_send_session_bound_cb()

int mq_send_session_bound_cb ( u32  app_wrk_index,
u32  api_context,
session_handle_t  handle,
int  rv 
)

Definition at line 351 of file session_api.c.

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

◆ mq_send_session_cleanup_cb()

static void mq_send_session_cleanup_cb ( session_t s,
session_cleanup_ntf_t  ntf 
)
static

Definition at line 566 of file session_api.c.

+ Here is the call graph for this function:

◆ mq_send_session_close_evt()

static void mq_send_session_close_evt ( app_worker_t app_wrk,
session_handle_t  sh,
session_evt_type_t  evt_type 
)
inlinestatic

Definition at line 198 of file session_api.c.

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

◆ mq_send_session_connected_cb()

int mq_send_session_connected_cb ( u32  app_wrk_index,
u32  api_context,
session_t s,
session_error_t  err 
)

Definition at line 266 of file session_api.c.

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

◆ mq_send_session_disconnected_cb()

static void mq_send_session_disconnected_cb ( session_t s)
static

Definition at line 239 of file session_api.c.

+ Here is the call graph for this function:

◆ mq_send_session_migrate_cb()

static void mq_send_session_migrate_cb ( session_t s,
session_handle_t  new_sh 
)
static

Definition at line 436 of file session_api.c.

+ Here is the call graph for this function:

◆ mq_send_session_reset_cb()

static void mq_send_session_reset_cb ( session_t s)
static

Definition at line 253 of file session_api.c.

+ Here is the call graph for this function:

◆ mq_send_unlisten_reply()

void mq_send_unlisten_reply ( app_worker_t app_wrk,
session_handle_t  sh,
u32  context,
int  rv 
)

Definition at line 413 of file session_api.c.

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

◆ mq_try_lock_and_alloc_msg()

static int mq_try_lock_and_alloc_msg ( svm_msg_q_t app_mq,
svm_msg_q_msg_t msg 
)
static

Definition at line 108 of file session_api.c.

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

◆ sapi_add_del_worker_handler()

static void sapi_add_del_worker_handler ( app_namespace_t app_ns,
clib_socket_t cs,
app_sapi_worker_add_del_msg_t mp 
)
static

Definition at line 1419 of file session_api.c.

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

◆ sapi_send_fds()

static void sapi_send_fds ( app_worker_t app_wrk,
int *  fds,
int  n_fds 
)
static

Definition at line 1190 of file session_api.c.

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

◆ sapi_sock_accept_ready()

static clib_error_t* sapi_sock_accept_ready ( clib_file_t scf)
static

Definition at line 1597 of file session_api.c.

+ Here is the caller graph for this function:

◆ sapi_sock_error()

static clib_error_t* sapi_sock_error ( clib_file_t cf)
static

Definition at line 1581 of file session_api.c.

+ Here is the call graph for this function:

◆ sapi_sock_read_ready()

static clib_error_t* sapi_sock_read_ready ( clib_file_t cf)
static

Definition at line 1526 of file session_api.c.

+ Here is the call graph for this function:

◆ sapi_sock_write_ready()

static clib_error_t* sapi_sock_write_ready ( clib_file_t cf)
static

Definition at line 1573 of file session_api.c.

◆ sapi_socket_close_w_handle()

static void sapi_socket_close_w_handle ( u32  api_handle)
static

Definition at line 1398 of file session_api.c.

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

◆ sapi_socket_detach()

static void sapi_socket_detach ( app_namespace_t app_ns,
clib_socket_t cs 
)
static

Definition at line 1501 of file session_api.c.

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

◆ send_session_rule_details4()

static void send_session_rule_details4 ( mma_rule_16_t *  rule,
u8  is_local,
u8  transport_proto,
u32  appns_index,
u8 tag,
vl_api_registration_t reg,
u32  context 
)
static

Definition at line 911 of file session_api.c.

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

◆ send_session_rule_details6()

static void send_session_rule_details6 ( mma_rule_40_t *  rule,
u8  is_local,
u8  transport_proto,
u32  appns_index,
u8 tag,
vl_api_registration_t reg,
u32  context 
)
static

Definition at line 953 of file session_api.c.

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

◆ send_session_rules_table_details()

static void send_session_rules_table_details ( session_rules_table_t srt,
u8  fib_proto,
u8  tp,
u8  is_local,
u32  appns_index,
vl_api_registration_t reg,
u32  context 
)
static

Definition at line 995 of file session_api.c.

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

◆ session_api_attach_handler()

static void session_api_attach_handler ( app_namespace_t app_ns,
clib_socket_t cs,
app_sapi_attach_msg_t mp 
)
static

Definition at line 1299 of file session_api.c.

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

◆ session_api_hookup()

static clib_error_t* session_api_hookup ( vlib_main_t vm)
static

Definition at line 1161 of file session_api.c.

+ Here is the call graph for this function:

◆ session_send_fds()

static int session_send_fds ( vl_api_registration_t reg,
int  fds[],
int  n_fds 
)
static

Definition at line 93 of file session_api.c.

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

◆ setup_message_id_table()

static void setup_message_id_table ( api_main_t am)
static

Definition at line 1146 of file session_api.c.

+ Here is the caller graph for this function:

◆ vl_api_app_add_cert_key_pair_t_handler()

static void vl_api_app_add_cert_key_pair_t_handler ( vl_api_app_add_cert_key_pair_t mp)
static

Definition at line 1058 of file session_api.c.

+ Here is the call graph for this function:

◆ vl_api_app_attach_t_handler()

static void vl_api_app_attach_t_handler ( vl_api_app_attach_t mp)
static

Definition at line 619 of file session_api.c.

+ Here is the call graph for this function:

◆ vl_api_app_del_cert_key_pair_t_handler()

static void vl_api_app_del_cert_key_pair_t_handler ( vl_api_app_del_cert_key_pair_t mp)
static

Definition at line 1108 of file session_api.c.

+ Here is the call graph for this function:

◆ vl_api_app_namespace_add_del_t_handler()

static void vl_api_app_namespace_add_del_t_handler ( vl_api_app_namespace_add_del_t mp)
static

Definition at line 835 of file session_api.c.

+ Here is the call graph for this function:

◆ vl_api_app_worker_add_del_t_handler()

static void vl_api_app_worker_add_del_t_handler ( vl_api_app_worker_add_del_t mp)
static

Definition at line 729 of file session_api.c.

+ Here is the call graph for this function:

◆ vl_api_application_detach_t_handler()

static void vl_api_application_detach_t_handler ( vl_api_application_detach_t mp)
static

Definition at line 809 of file session_api.c.

+ Here is the call graph for this function:

◆ vl_api_session_enable_disable_t_handler()

static void vl_api_session_enable_disable_t_handler ( vl_api_session_enable_disable_t mp)
static

Definition at line 608 of file session_api.c.

+ Here is the call graph for this function:

◆ vl_api_session_rule_add_del_t_handler()

static void vl_api_session_rule_add_del_t_handler ( vl_api_session_rule_add_del_t mp)
static

Definition at line 879 of file session_api.c.

+ Here is the call graph for this function:

◆ vl_api_session_rules_dump_t_handler()

static void vl_api_session_rules_dump_t_handler ( vl_api_session_rules_dump_t mp)
static

Definition at line 1034 of file session_api.c.

+ Here is the call graph for this function:

◆ VL_MSG_API_REAPER_FUNCTION()

VL_MSG_API_REAPER_FUNCTION ( application_reaper_cb  )

◆ VLIB_API_INIT_FUNCTION()

VLIB_API_INIT_FUNCTION ( session_api_hookup  )

Variable Documentation

◆ session_mq_cb_vft

session_cb_vft_t session_mq_cb_vft
static
Initial value:
= {
.session_accept_callback = mq_send_session_accepted_cb,
.session_disconnect_callback = mq_send_session_disconnected_cb,
.session_connected_callback = mq_send_session_connected_cb,
.session_reset_callback = mq_send_session_reset_cb,
.session_migrate_callback = mq_send_session_migrate_cb,
.session_cleanup_callback = mq_send_session_cleanup_cb,
.add_segment_callback = mq_send_add_segment_cb,
.del_segment_callback = mq_send_del_segment_cb,
}

Definition at line 596 of file session_api.c.

◆ session_mq_sapi_cb_vft

session_cb_vft_t session_mq_sapi_cb_vft
static
Initial value:
= {
.session_accept_callback = mq_send_session_accepted_cb,
.session_disconnect_callback = mq_send_session_disconnected_cb,
.session_connected_callback = mq_send_session_connected_cb,
.session_reset_callback = mq_send_session_reset_cb,
.session_migrate_callback = mq_send_session_migrate_cb,
.session_cleanup_callback = mq_send_session_cleanup_cb,
.add_segment_callback = mq_send_add_segment_sapi_cb,
.del_segment_callback = mq_send_del_segment_sapi_cb,
}

Definition at line 1287 of file session_api.c.

mq_send_add_segment_sapi_cb
static int mq_send_add_segment_sapi_cb(u32 app_wrk_index, u64 segment_handle)
Definition: session_api.c:1211
mq_send_add_segment_cb
static int mq_send_add_segment_cb(u32 app_wrk_index, u64 segment_handle)
Definition: session_api.c:471
mq_send_del_segment_cb
static int mq_send_del_segment_cb(u32 app_wrk_index, u64 segment_handle)
Definition: session_api.c:533
mq_send_session_cleanup_cb
static void mq_send_session_cleanup_cb(session_t *s, session_cleanup_ntf_t ntf)
Definition: session_api.c:566
mq_send_session_reset_cb
static void mq_send_session_reset_cb(session_t *s)
Definition: session_api.c:253
mq_send_session_migrate_cb
static void mq_send_session_migrate_cb(session_t *s, session_handle_t new_sh)
Definition: session_api.c:436
mq_send_del_segment_sapi_cb
static int mq_send_del_segment_sapi_cb(u32 app_wrk_index, u64 segment_handle)
Definition: session_api.c:1262
mq_send_session_disconnected_cb
static void mq_send_session_disconnected_cb(session_t *s)
Definition: session_api.c:239
mq_send_session_accepted_cb
static int mq_send_session_accepted_cb(session_t *s)
Definition: session_api.c:127
mq_send_session_connected_cb
int mq_send_session_connected_cb(u32 app_wrk_index, u32 api_context, session_t *s, session_error_t err)
Definition: session_api.c:266