38 #define vl_print(handle, ...) vlib_cli_output (handle, __VA_ARGS__) 45 #define foreach_session_api_msg \ 46 _(APP_ATTACH, app_attach) \ 47 _(APPLICATION_DETACH, application_detach) \ 48 _(SESSION_ENABLE_DISABLE, session_enable_disable) \ 49 _(APP_NAMESPACE_ADD_DEL, app_namespace_add_del) \ 50 _(SESSION_RULE_ADD_DEL, session_rule_add_del) \ 51 _(SESSION_RULES_DUMP, session_rules_dump) \ 52 _(APPLICATION_TLS_CERT_ADD, application_tls_cert_add) \ 53 _(APPLICATION_TLS_KEY_ADD, application_tls_key_add) \ 54 _(APP_ADD_CERT_KEY_PAIR, app_add_cert_key_pair) \ 55 _(APP_DEL_CERT_KEY_PAIR, app_del_cert_key_pair) \ 56 _(APP_WORKER_ADD_DEL, app_worker_add_del) \ 64 return TRANSPORT_PROTO_TCP;
66 return TRANSPORT_PROTO_UDP;
68 return TRANSPORT_PROTO_TLS;
70 return TRANSPORT_PROTO_QUIC;
72 return TRANSPORT_PROTO_NONE;
76 static vl_api_transport_proto_t
81 case TRANSPORT_PROTO_TCP:
83 case TRANSPORT_PROTO_UDP:
85 case TRANSPORT_PROTO_TLS:
87 case TRANSPORT_PROTO_QUIC:
99 return SESSION_E_BAPI_NO_FD;
104 return SESSION_E_BAPI_SEND_FD;
136 session_event_t *evt;
142 return SESSION_E_MQ_MSG_ALLOC;
181 mp->
rmt.port = ct->c_rmt_port;
198 session_event_t *evt;
205 evt->event_type = evt_type;
224 for (i = 0; i < f->n_subscribers; i++)
268 session_event_t *evt;
280 return SESSION_E_MQ_MSG_ALLOC;
298 err = SESSION_E_REFUSED;
319 mp->
lcl.port = cct->c_lcl_port;
320 mp->
lcl.is_ip4 = cct->c_is_ip4;
348 session_event_t *evt;
361 return SESSION_E_MQ_MSG_ALLOC;
406 session_event_t *evt;
429 session_event_t *evt;
457 session_event_t *evt;
483 fd_flags |= SESSION_FD_F_MEMFD_SEGMENT;
518 session_event_t *evt;
550 session_event_t *evt;
589 vl_api_session_enable_disable_reply_t *rmp;
604 u8 fd_flags = 0, ctrl_thread;
614 rv = VNET_API_ERROR_FEATURE_DISABLED;
620 rv = VNET_API_ERROR_APP_UNSUPPORTED_CFG;
626 "Out of options, fix api message definition");
645 fd_flags |= SESSION_FD_F_VPP_MQ_SEGMENT;
646 fds[n_fds] = evt_q_segment->
fd;
652 fd_flags |= SESSION_FD_F_MEMFD_SEGMENT;
653 fds[n_fds] = a->segment->fd;
658 fd_flags |= SESSION_FD_F_MQ_EVENTFD;
671 rmp->
app_index = clib_host_to_net_u32 (a->app_index);
702 rv = VNET_API_ERROR_FEATURE_DISABLED;
713 rv = VNET_API_ERROR_INVALID_VALUE;
719 .wrk_map_index = clib_net_to_host_u32 (mp->
wrk_index),
736 fd_flags |= SESSION_FD_F_MEMFD_SEGMENT;
737 fds[n_fds] = args.segment->fd;
742 fd_flags |= SESSION_FD_F_MQ_EVENTFD;
751 rmp->
wrk_index = clib_host_to_net_u32 (args.wrk_map_index);
755 if (
vec_len (args.segment->name))
773 vl_api_application_detach_reply_t *rmp;
774 int rv = VNET_API_ERROR_INVALID_VALUE_2;
780 rv = VNET_API_ERROR_FEATURE_DISABLED;
805 rv = VNET_API_ERROR_FEATURE_DISABLED;
813 .secret = clib_net_to_host_u64 (mp->
secret),
814 .sw_if_index = clib_net_to_host_u32 (mp->
sw_if_index),
815 .ip4_fib_id = clib_net_to_host_u32 (mp->
ip4_fib_id),
816 .ip6_fib_id = clib_net_to_host_u32 (mp->
ip6_fib_id),
826 rv = VNET_API_ERROR_UNSPECIFIED;
835 rmp->
appns_index = clib_host_to_net_u32 (appns_index);
843 vl_api_session_rule_add_del_reply_t *rmp;
853 table_args->lcl_port = mp->
lcl_port;
854 table_args->rmt_port = mp->
rmt_port;
855 table_args->action_index = clib_net_to_host_u32 (mp->
action_index);
856 table_args->is_add = mp->
is_add;
857 mp->
tag[
sizeof (mp->
tag) - 1] = 0;
858 table_args->tag =
format (0,
"%s", mp->
tag);
859 args.appns_index = clib_net_to_host_u32 (mp->
appns_index);
860 args.scope = mp->
scope;
861 args.transport_proto =
863 TRANSPORT_PROTO_UDP ? 1 : 0;
878 session_mask_or_match_4_t *match =
879 (session_mask_or_match_4_t *) & rule->match;
880 session_mask_or_match_4_t *
mask =
881 (session_mask_or_match_4_t *) & rule->mask;
886 rmp->_vl_msg_id =
ntohs (VL_API_SESSION_RULES_DETAILS);
900 rmp->
action_index = clib_host_to_net_u32 (rule->action_index);
904 rmp->
appns_index = clib_host_to_net_u32 (appns_index);
920 session_mask_or_match_6_t *match =
921 (session_mask_or_match_6_t *) & rule->match;
922 session_mask_or_match_6_t *
mask =
923 (session_mask_or_match_6_t *) & rule->mask;
928 rmp->_vl_msg_id =
ntohs (VL_API_SESSION_RULES_DETAILS);
942 rmp->
action_index = clib_host_to_net_u32 (rule->action_index);
946 rmp->
appns_index = clib_host_to_net_u32 (appns_index);
961 mma_rule_16_t *rule16;
962 mma_rule_40_t *rule40;
963 mma_rules_table_16_t *srt16;
964 mma_rules_table_40_t *srt40;
971 srt16 = &srt->session_rules_tables_16;
973 ri = mma_rules_table_rule_index_16 (srt16, rule16);
984 srt40 = &srt->session_rules_tables_40;
986 ri = mma_rules_table_rule_index_40 (srt40, rule40);
1011 st->active_fib_proto, tp,
1012 st->is_local, st->appns_index, reg,
1028 rv = VNET_API_ERROR_FEATURE_DISABLED;
1032 cert_len = clib_net_to_host_u16 (mp->
cert_len);
1033 if (cert_len > 10000)
1035 rv = VNET_API_ERROR_INVALID_VALUE;
1039 certkey_len = clib_net_to_host_u16 (mp->
certkey_len);
1040 if (certkey_len < cert_len)
1042 rv = VNET_API_ERROR_INVALID_VALUE;
1046 key_len = certkey_len - cert_len;
1047 if (key_len > 10000)
1049 rv = VNET_API_ERROR_INVALID_VALUE;
1066 rmp->
index = clib_host_to_net_u32 (a->index);
1074 vl_api_app_del_cert_key_pair_reply_t *rmp;
1079 rv = VNET_API_ERROR_FEATURE_DISABLED;
1082 ckpair_index = clib_net_to_host_u32 (mp->
index);
1094 vl_api_application_tls_cert_add_reply_t *rmp;
1101 rv = VNET_API_ERROR_FEATURE_DISABLED;
1106 rv = VNET_API_ERROR_APPLICATION_NOT_ATTACHED;
1109 cert_len = clib_net_to_host_u16 (mp->
cert_len);
1110 if (cert_len > 10000)
1112 rv = VNET_API_ERROR_INVALID_VALUE;
1120 REPLY_MACRO (VL_API_APPLICATION_TLS_CERT_ADD_REPLY);
1128 vl_api_application_tls_key_add_reply_t *rmp;
1135 rv = VNET_API_ERROR_FEATURE_DISABLED;
1140 rv = VNET_API_ERROR_APPLICATION_NOT_ATTACHED;
1143 key_len = clib_net_to_host_u16 (mp->
key_len);
1144 if (key_len > 10000)
1146 rv = VNET_API_ERROR_INVALID_VALUE;
1153 REPLY_MACRO (VL_API_APPLICATION_TLS_KEY_ADD_REPLY);
1164 a->api_client_index = client_index;
1172 #define vl_msg_name_crc_list 1174 #undef vl_msg_name_crc_list 1179 #define _(id,n,crc) vl_msg_api_add_msg_name_crc (am, #n "_" #crc, id); 1180 foreach_vl_msg_name_crc_session;
1197 vl_msg_api_set_handlers(VL_API_##N, #n, \ 1198 vl_api_##n##_t_handler, \ 1200 vl_api_##n##_t_endian, \ 1201 vl_api_##n##_t_print, \ 1202 sizeof(vl_api_##n##_t), 1); 1248 session_event_t *evt;
1260 fd_flags |= SESSION_FD_F_MEMFD_SEGMENT;
1261 fds[n_fds] = sp->
fd;
1298 session_event_t *evt;
1337 u8 fd_flags = 0, ctrl_thread;
1349 a->name =
format (0,
"%s", (
char *) mp->
name);
1352 a->use_sock_api = 1;
1364 fd_flags |= SESSION_FD_F_VPP_MQ_SEGMENT;
1365 fds[n_fds] = evt_q_segment->
fd;
1371 fd_flags |= SESSION_FD_F_MEMFD_SEGMENT;
1372 fds[n_fds] = a->segment->fd;
1377 fd_flags |= SESSION_FD_F_MQ_EVENTFD;
1406 handle->aah_app_wrk_index = app_wrk->
wrk_index;
1417 u16 sock_index = api_handle & 0xffff;
1444 u32 sapi_handle = -1;
1451 rv = VNET_API_ERROR_INVALID_VALUE;
1460 .api_client_index = sapi_handle,
1479 fd_flags |= SESSION_FD_F_MEMFD_SEGMENT;
1480 fds[n_fds] = args.segment->fd;
1485 fd_flags |= SESSION_FD_F_MQ_EVENTFD;
1509 handle->aah_app_wrk_index = app_wrk->
wrk_index;
1520 u32 api_client_handle;
1532 .api_client_index = api_client_handle,
1577 handle->aah_app_wrk_index, msg.
type);
1591 clib_warning (
"called for app ns %u", handle->aah_app_ns_index);
1643 cf.file_descriptor = ccs->fd;
1646 cf.private_data = handle.as_u64;
1647 cf.description =
format (0,
"app sock conn fd: %d", ccs->fd);
1653 ccs->private_data = handle.as_u64;
1665 char *subdir =
"/app_ns_sockets/";
1668 struct stat file_stat;
1676 vec_add (dir, (
u8 *) subdir, strlen (subdir));
1686 app_ns->sock_name =
format (0,
"%v%v%c", dir, app_ns->ns_id, 0);
1692 cs->config = (
char *) app_ns->sock_name;
1704 if (stat ((
char *) app_ns->sock_name, &file_stat) == -1)
session_handle_t new_handle
static void session_api_attach_handler(app_namespace_t *app_ns, clib_socket_t *cs, app_sapi_attach_msg_t *mp)
#define vec_validate(V, I)
Make sure vector is long enough for given index (no header, unspecified alignment) ...
struct _vnet_app_worker_add_del_args vnet_app_worker_add_del_args_t
app_sapi_attach_reply_msg_t attach_reply
#define APP_NAMESPACE_INVALID_INDEX
static clib_error_t * session_api_hookup(vlib_main_t *vm)
static void clib_file_del(clib_file_main_t *um, clib_file_t *f)
void * svm_msg_q_msg_data(svm_msg_q_t *mq, svm_msg_q_msg_t *msg)
Get data for message in queue.
session_type_t session_type
Type built from transport and network protocol types.
static void vl_api_app_del_cert_key_pair_t_handler(vl_api_app_del_cert_key_pair_t *mp)
app_cert_key_pair_t * app_cert_key_pair_get_default()
void mq_send_unlisten_reply(app_worker_t *app_wrk, session_handle_t sh, u32 context, int rv)
int vnet_app_add_cert_key_pair(vnet_app_add_cert_key_pair_args_t *a)
static void mq_notify_close_subscribers(u32 app_index, session_handle_t sh, svm_fifo_t *f, session_evt_type_t evt_type)
VL_MSG_API_REAPER_FUNCTION(application_reaper_cb)
#define TRANSPORT_N_PROTOS
void ip_prefix_decode(const vl_api_prefix_t *in, fib_prefix_t *out)
struct _session_rules_table_t session_rules_table_t
u32 ns_index
Namespace the application belongs to.
vl_api_transport_proto_t transport_proto
Application add TLS key WILL BE DEPRECATED POST 20.01
#define pool_foreach(VAR, POOL)
Iterate through pool.
static void sapi_send_fds(app_worker_t *app_wrk, int *fds, int n_fds)
static void vl_api_app_namespace_add_del_t_handler(vl_api_app_namespace_add_del_t *mp)
int vnet_app_namespace_add_del(vnet_app_namespace_add_del_args_t *a)
u32 app_namespace_index(app_namespace_t *app_ns)
static svm_msg_q_t * session_main_get_vpp_event_queue(u32 thread_index)
uword vpp_event_queue_address
vl_api_transport_proto_t transport_proto
void ip_set(ip46_address_t *dst, void *src, u8 is_ip4)
#define clib_memcpy_fast(a, b, c)
static void mq_send_session_close_evt(app_worker_t *app_wrk, session_handle_t sh, session_evt_type_t evt_type)
#define REPLY_MACRO2(t, body)
u8 * session_rules_table_rule_tag(session_rules_table_t *srt, u32 ri, u8 is_ip4)
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
static clib_socket_t * appns_sapi_alloc_socket(app_namespace_t *app_ns)
transport_connection_t * session_get_transport(session_t *s)
app_sapi_worker_add_del_msg_t worker_add_del
svm_fifo_t * rx_fifo
Pointers to rx/tx buffers.
static void vl_api_send_msg(vl_api_registration_t *rp, u8 *elem)
vl_api_session_rule_scope_t scope
u32 ip4_mask_to_preflen(ip4_address_t *mask)
fifo_segment_t * segment_manager_get_segment_w_handle(u64 segment_handle)
static u32 appns_sapi_socket_index(app_namespace_t *app_ns, clib_socket_t *cs)
static session_t * listen_session_get_from_handle(session_handle_t handle)
int vnet_app_del_cert_key_pair(u32 index)
static int svm_msg_q_get_producer_eventfd(svm_msg_q_t *mq)
static transport_proto_t session_get_transport_proto(session_t *s)
struct _vnet_app_namespace_add_del_args vnet_app_namespace_add_del_args_t
application_t * application_lookup(u32 api_client_index)
static int mq_send_del_segment_cb(u32 app_wrk_index, u64 segment_handle)
u32 wrk_map_index
Worker index in app's map pool.
#define foreach_session_api_msg
static clib_socket_t * appns_sapi_get_socket(app_namespace_t *app_ns, u32 sock_index)
void * vl_msg_api_alloc(int nbytes)
u64 app_event_queue_address
app_worker_t * application_get_worker(application_t *app, u32 wrk_map_index)
static void sapi_socket_detach(app_namespace_t *app_ns, clib_socket_t *cs)
application_t * application_get_if_valid(u32 app_index)
__clib_export clib_error_t * clib_socket_init(clib_socket_t *s)
segment_manager_props_t * application_segment_manager_properties(application_t *app)
clib_file_function_t * read_function
#define vlib_worker_thread_barrier_sync(X)
static session_handle_t session_handle(session_t *s)
void session_get_endpoint(session_t *s, transport_endpoint_t *tep, u8 is_lcl)
#define vec_add(V, E, N)
Add N elements to end of vector V (no header, unspecified alignment)
#define CLIB_SOCKET_F_IS_SERVER
int svm_msg_q_lock_and_alloc_msg_w_ring(svm_msg_q_t *mq, u32 ring_index, u8 noblock, svm_msg_q_msg_t *msg)
Lock message queue and allocate message buffer on ring.
Reply for app worker add/del.
app_sapi_worker_add_del_reply_msg_t worker_add_del_reply
int application_is_proxy(application_t *app)
static void mq_send_session_reset_cb(session_t *s)
static clib_file_t * clib_file_get(clib_file_main_t *fm, u32 file_index)
static void vl_api_session_enable_disable_t_handler(vl_api_session_enable_disable_t *mp)
static char * vlib_unix_get_runtime_dir(void)
Application attach reply.
u32 session_index
global listening session index
static clib_error_t * clib_socket_sendmsg(clib_socket_t *s, void *msg, int msglen, int fds[], int num_fds)
vl_api_registration_t * vl_mem_api_client_index_to_registration(u32 handle)
description fragment has unexpected format
static clib_error_t * sapi_sock_write_ready(clib_file_t *cf)
add/del application namespace
Aggregate type for a prefix.
static void vl_api_application_tls_cert_add_t_handler(vl_api_application_tls_cert_add_t *mp)
static u32 appns_sapi_socket_handle(app_namespace_t *app_ns, clib_socket_t *cs)
clib_file_main_t file_main
static clib_error_t * clib_socket_recvmsg(clib_socket_t *s, void *msg, int msglen, int fds[], int num_fds)
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)
u32 app_namespace_index_from_id(const u8 *ns_id)
u16 fp_len
The mask length.
struct _vnet_app_attach_args_t vnet_app_attach_args_t
static void vl_api_app_worker_add_del_t_handler(vl_api_app_worker_add_del_t *mp)
static void appns_sapi_free_socket(app_namespace_t *app_ns, clib_socket_t *cs)
static void mq_send_session_cleanup_cb(session_t *s, session_cleanup_ntf_t ntf)
static void sapi_add_del_worker_handler(app_namespace_t *app_ns, clib_socket_t *cs, app_sapi_worker_add_del_msg_t *mp)
session_t * app_listener_get_local_session(app_listener_t *al)
#define VL_API_INVALID_FI
ip46_address_t fp_addr
The address type is not deriveable from the fp_addr member.
session_t * app_listener_get_session(app_listener_t *al)
bool is_add[default=true]
struct _session_rule_add_del_args session_rule_add_del_args_t
static clib_error_t * clib_socket_close(clib_socket_t *sock)
static int session_send_fds(vl_api_registration_t *reg, int fds[], int n_fds)
#define APP_INVALID_INDEX
static void vl_api_session_rules_dump_t_handler(vl_api_session_rules_dump_t *mp)
int vnet_session_rule_add_del(session_rule_add_del_args_t *args)
app_namespace_t * app_namespace_get(u32 index)
static clib_error_t * application_reaper_cb(u32 client_index)
u32 wrk_index
Worker index in global worker pool.
app_worker_t * app_worker_get_if_valid(u32 wrk_index)
#define SESSION_INVALID_INDEX
uword vpp_event_queue_address
static void sapi_socket_close_w_handle(u32 api_handle)
u64 session_segment_handle(session_t *s)
bool is_add[default=true]
clib_error_t * vnet_session_enable_disable(vlib_main_t *vm, u8 is_en)
session_handle_t app_listen_session_handle(session_t *ls)
Get app listener handle for listening session.
static u64 listen_session_get_handle(session_t *s)
API main structure, used by both vpp and binary API clients.
int vnet_application_attach(vnet_app_attach_args_t *a)
Attach application to vpp.
static int mq_try_lock_and_alloc_msg(svm_msg_q_t *app_mq, svm_msg_q_msg_t *msg)
An API client registration, only in vpp/vlib.
static clib_error_t * sapi_sock_read_ready(clib_file_t *cf)
ssvm_private_t ssvm
ssvm segment data
session_handle_t listener_handle
Parent listener session index if the result of an accept.
session_t * app_worker_first_listener(app_worker_t *app, u8 fib_proto, u8 transport_proto)
sll srl srl sll sra u16x4 i
#define vec_free(V)
Free vector's memory (no header).
__clib_export clib_error_t * clib_socket_accept(clib_socket_t *server, clib_socket_t *client)
static clib_error_t * sapi_sock_accept_ready(clib_file_t *scf)
#define clib_warning(format, args...)
static int mq_send_del_segment_sapi_cb(u32 app_wrk_index, u64 segment_handle)
struct _transport_connection transport_connection_t
static void mq_send_session_disconnected_cb(session_t *s)
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 vl_api_registration_t * vl_api_client_index_to_registration(u32 index)
static clib_error_t * vl_api_send_fd_msg(vl_api_registration_t *reg, int fds[], int n_fds)
static u32 vl_api_registration_file_index(vl_api_registration_t *reg)
struct _app_namespace app_namespace_t
application_t * application_get(u32 app_index)
vl_api_interface_index_t sw_if_index[default=0xffffffff]
static u32 session_thread_from_handle(session_handle_t handle)
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)
app_listener_t * app_listener_get_w_handle(session_handle_t handle)
Get app listener for listener session handle.
void svm_msg_q_add_and_unlock(svm_msg_q_t *mq, svm_msg_q_msg_t *msg)
Producer enqueue one message to queue with mutex held.
enable/disable session layer
bool is_enable[default=true]
session_t * ct_session_get_peer(session_t *s)
Reply for app namespace add/del.
static uword clib_file_add(clib_file_main_t *um, clib_file_t *template)
Application detach from session layer.
app_sapi_attach_msg_t attach
static fib_protocol_t session_get_fib_proto(session_t *s)
static void mq_send_session_migrate_cb(session_t *s, session_handle_t new_sh)
static u32 appns_sapi_handle_sock_index(u32 sapi_sock_handle)
int vnet_application_detach(vnet_app_detach_args_t *a)
Detach application from vpp.
int appns_sapi_add_ns_socket(app_namespace_t *app_ns)
enum _transport_proto transport_proto_t
#define clib_error_report(e)
struct _vnet_app_add_cert_key_pair_args_ vnet_app_add_cert_key_pair_args_t
struct _socket_t clib_socket_t
static int mq_send_session_accepted_cb(session_t *s)
vl_api_session_rule_scope_t scope
static void vl_api_app_attach_t_handler(vl_api_app_attach_t *mp)
u32 ip6_mask_to_preflen(ip6_address_t *mask)
struct _vnet_app_detach_args_t vnet_app_detach_args_t
static uword pointer_to_uword(const void *p)
#define CLIB_SOCKET_F_SEQPACKET
static void vl_api_app_add_cert_key_pair_t_handler(vl_api_app_add_cert_key_pair_t *mp)
static vlib_main_t * vlib_get_main(void)
u8 thread_index
Index of the thread that allocated the session.
static transport_proto_t api_session_transport_proto_decode(const vl_api_transport_proto_t *api_tp)
void ip_prefix_encode(const fib_prefix_t *in, vl_api_prefix_t *out)
static void setup_message_id_table(api_main_t *am)
u32 app_index
App index in app pool.
static u8 session_type_is_ip4(session_type_t st)
static session_cb_vft_t session_mq_cb_vft
add/del application worker
clib_error_t * vlib_unix_recursive_mkdir(char *path)
int mq_send_session_connected_cb(u32 app_wrk_index, u32 api_context, session_t *s, session_error_t err)
app_worker_t * app_worker_get(u32 wrk_index)
static clib_error_t * sapi_sock_error(clib_file_t *cf)
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
void vlib_rpc_call_main_thread(void *callback, u8 *args, u32 arg_size)
volatile u8 session_state
State in session layer state machine.
#define STATIC_ASSERT(truth,...)
#define CLIB_SOCKET_F_PASSCRED
static void vl_api_application_tls_key_add_t_handler(vl_api_application_tls_key_add_t *mp)
ssvm_private_t * session_main_get_evt_q_segment(void)
static vl_api_transport_proto_t api_session_transport_proto_encode(const transport_proto_t tp)
VLIB_API_INIT_FUNCTION(session_api_hookup)
#define clib_error_free(e)
struct _session_lookup_table session_table_t
int vnet_app_worker_add_del(vnet_app_worker_add_del_args_t *a)
static void vl_api_application_detach_t_handler(vl_api_application_detach_t *mp)
u64 app_event_queue_address
static u8 session_has_transport(session_t *s)
struct _session_rules_table_add_del_args session_rule_table_add_del_args_t
u8 appns_sapi_enabled(void)
u32 app_index
Index of owning app.
static api_main_t * vlibapi_get_main(void)
static u8 svm_fifo_n_subscribers(svm_fifo_t *f)
Fifo number of subscribers getter.
#define session_table_foreach(VAR, BODY)
void vlib_worker_thread_barrier_release(vlib_main_t *vm)
Application add TLS certificate WILL BE DEPRECATED POST 20.01
static u32 vlib_num_workers()
static session_cb_vft_t session_mq_sapi_cb_vft
enum session_error_ session_error_t
u32 app_wrk_index
Index of the app worker that owns the session.
static void vl_api_session_rule_add_del_t_handler(vl_api_session_rule_add_del_t *mp)
int(* session_accept_callback)(session_t *new_session)
Notify server of newly accepted session.
u32 api_client_index
API index for the worker.
int mq_send_session_bound_cb(u32 app_wrk_index, u32 api_context, session_handle_t handle, int rv)
#define CLIB_SOCKET_F_ALLOW_GROUP_WRITE
static int mq_send_add_segment_sapi_cb(u32 app_wrk_index, u64 segment_handle)
svm_msg_q_t * event_queue
Application listens for events on this svm queue.
static transport_service_type_t session_transport_service_type(session_t *s)
struct _svm_fifo svm_fifo_t
Application attach to session layer.
u8 * vl_api_from_api_to_new_vec(void *mp, vl_api_string_t *astr)
Delete certificate and key.
int vl_api_vec_to_api_string(const u8 *vec, vl_api_string_t *str)
static int mq_send_add_segment_cb(u32 app_wrk_index, u64 segment_handle)
non-blocking call - works with both condvar and eventfd signaling
bool is_add[default=true]
static u8 session_main_is_enabled()
ssvm_segment_type_t ssvm_type(const ssvm_private_t *ssvm)