|
FD.io VPP
v21.06-3-gbb25fbf28
Vector Packet Processing
|
Go to the documentation of this file.
24 #define app_interface_check_thread_and_barrier(_fn, _arg) \
25 if (PREDICT_FALSE (!vlib_thread_is_main_w_barrier ())) \
27 vlib_rpc_call_main_thread (_fn, (u8 *) _arg, sizeof(*_arg)); \
36 clib_memset (app_listener, 0,
sizeof (*app_listener));
56 clib_memset (app_listener, 0xfa,
sizeof (*app_listener));
100 u32 table_index, fib_proto;
105 ip46_address_t original_ip;
140 ip_copy (&original_ip, &sep_ext->ip, sep_ext->is_ip4);
141 ip_set (&sep_ext->ip, iface_ip, sep_ext->is_ip4);
143 ip_copy (&sep_ext->ip, &original_ip, sep_ext->is_ip4);
162 u32 al_index, table_index;
366 app_ns->ip4_fib_index);
369 app_ns->ip6_fib_index);
379 return app_ns->local_table_index;
491 int __clib_unused
rv;
533 .name =
"appsl-rx-mqs-input",
535 .state = VLIB_NODE_STATE_DISABLED,
589 template.file_descriptor = fd;
590 template.private_data = handle.
as_u64;
592 template.description =
626 u32 evt_q_length, evt_size =
sizeof (session_event_t);
633 evt_q_length =
clib_max (props->evt_q_size, 128);
637 { evt_q_length, evt_size, 0 }, { evt_q_length >> 1, 256, 0 }
650 return SESSION_E_SEG_CREATE;
659 for (
i = 0;
i < n_mqs;
i++)
667 return SESSION_E_EVENTFD_ALLOC;
693 u8 state = is_en ? VLIB_NODE_STATE_INTERRUPT : VLIB_NODE_STATE_DISABLED;
732 clib_warning (
"No session connected callback function provided");
734 clib_warning (
"No session disconnect callback function provided");
736 clib_warning (
"No session reset callback function provided");
752 clib_warning (
"memfd seg: vpp's event qs IN binary api svm region");
759 clib_warning (
"shm seg: vpp's event qs NOT IN binary api svm region");
785 clib_warning (
"mq eventfds can only be used if socket transport is "
786 "used for binary api");
787 return VNET_API_ERROR_APP_UNSUPPORTED_CFG;
791 return VNET_API_ERROR_APP_UNSUPPORTED_CFG;
795 return VNET_API_ERROR_APP_UNSUPPORTED_CFG;
801 app->
cb_fns = *
a->session_cb_vft;
809 app->
flags |= APP_OPTIONS_FLAGS_USE_GLOBAL_SCOPE;
819 props->add_segment = 1;
828 props->use_mq_eventfd = 1;
839 props->segment_type = seg_type;
849 APP_DBG (
"New app name: %v api index: %u index %u", app->
name,
876 app_wrk = app_worker_get (wrk_map->wrk_index);
877 app_worker_free (app_wrk);
910 u32 *wrks = 0, *wrk_index;
913 if (api_client_index == ~0)
919 APP_DBG (
"Detaching for app %v index %u api client index %u", app->
name,
938 args->api_client_index = api_client_index;
1006 sm->first_is_protected = 1;
1033 return VNET_API_ERROR_INVALID_VALUE;
1046 a->segment = &fs->
ssvm;
1056 return VNET_API_ERROR_INVALID_VALUE;
1060 return VNET_API_ERROR_INVALID_VALUE;
1075 if (
vec_len (namespace_id) == 0)
1084 return VNET_API_ERROR_APP_INVALID_NS;
1087 return VNET_API_ERROR_APP_INVALID_NS;
1088 if (app_ns->ns_secret != secret)
1089 return VNET_API_ERROR_APP_WRONG_NS_SECRET;
1101 clib_warning (
"api client index %u does not have an api registration!",
1103 return format (0,
"unknown");
1120 u32 app_ns_index = 0;
1130 return VNET_API_ERROR_INVALID_VALUE;
1133 return VNET_API_ERROR_APP_ALREADY_ATTACHED;
1136 if (!
a->use_sock_api)
1172 a->segment = &fs->
ssvm;
1196 return VNET_API_ERROR_APPLICATION_NOT_ATTACHED;
1212 clib_warning (
"sw_if_index %u not configured with ip %U",
1217 return (is_lep ||
ip_is_local (sep->fib_index, &sep->ip, sep->is_ip4));
1225 u32 ns_index, fib_index;
1230 if (app->
flags & APP_OPTIONS_FLAGS_IS_TRANSPORT_APP)
1231 ns_index = sep->ns_index;
1244 fib_index = sep->fib_index;
1246 fib_index = sep->is_ip4 ? app_ns->ip4_fib_index : app_ns->ip6_fib_index;
1247 sep->peer.fib_index = fib_index;
1248 sep->fib_index = fib_index;
1252 sep->sw_if_index = app_ns->sw_if_index;
1258 && sep->peer.sw_if_index != app_ns->sw_if_index)
1259 clib_warning (
"Local sw_if_index different from app ns sw_if_index");
1261 sep->peer.sw_if_index = app_ns->sw_if_index;
1277 return SESSION_E_NOAPP;
1281 return SESSION_E_INVALID_APPWRK;
1283 a->sep_ext.app_wrk_index = app_wrk->
wrk_index;
1287 return SESSION_E_INVALID_NS;
1296 return SESSION_E_ALREADY_LISTENING;
1328 return SESSION_E_INVALID_RMT_IP;
1334 a->sep_ext.opaque =
a->api_context;
1345 a->sep_ext.original_tp =
a->sep_ext.transport_proto;
1346 a->sep_ext.transport_proto = TRANSPORT_PROTO_NONE;
1348 a->sep_ext.transport_proto =
a->sep_ext.original_tp;
1349 if (!
rv ||
rv != SESSION_E_LOCAL_CONNECT)
1368 return SESSION_E_NOAPP;
1371 return SESSION_E_NOLISTEN;
1376 return SESSION_E_OWNER;
1383 return SESSION_E_INVALID_APPWRK;
1397 return SESSION_E_NOSESSION;
1401 return SESSION_E_OWNER;
1418 return SESSION_E_NOSESSION;
1422 return SESSION_E_OWNER;
1440 return SESSION_E_INVALID_APPWRK;
1449 return SESSION_E_NOAPP;
1468 return (app->
flags & APP_OPTIONS_FLAGS_IS_PROXY);
1474 return (app->
flags & APP_OPTIONS_FLAGS_IS_BUILTIN);
1486 return app->
flags & APP_OPTIONS_FLAGS_USE_LOCAL_SCOPE;
1492 return app->
flags & APP_OPTIONS_FLAGS_USE_GLOBAL_SCOPE;
1515 sep.is_ip4 = is_ip4;
1517 sep.sw_if_index = app_ns->sw_if_index;
1523 app->
flags &= ~APP_OPTIONS_FLAGS_USE_LOCAL_SCOPE;
1529 s->
flags |= SESSION_F_PROXY;
1543 sep.is_ip4 = is_ip4;
1613 if (transports & (1 << tp))
1629 if (transports & (1 << tp))
1670 vlib_cli_output (vm,
"%U", format_app_worker_listener, app_wrk,
1671 handle, sm_index, verbose);
1701 int key_len = 0, cert_len = 0;
1705 s =
format (s,
"DEFAULT (cert:%d, key:%d)", cert_len,
key_len);
1715 u32 engine = va_arg (*args,
u32);
1719 return format (s,
"none");
1721 return format (s,
"mbedtls");
1723 return format (s,
"openssl");
1725 return format (s,
"picotls");
1727 return format (s,
"vpp");
1729 return format (s,
"unknown engine");
1737 u8 *
a = va_arg (*args,
u8 *);
1740 else if (
unformat (input,
"openssl"))
1742 else if (
unformat (input,
"picotls"))
1774 s =
format (s,
"%-10s%-20s%-40s",
"Index",
"Name",
"Namespace");
1788 s =
format (s,
"app-name %v app-index %u ns-index %u seg-size %U\n",
1791 s =
format (s,
"rx-fifo-size %U tx-fifo-size %U workers:\n",
1889 for (
i = 0;
i < n_threads;
i++)
1907 int do_server = 0, do_client = 0, do_mq = 0;
1918 else if (
unformat (input,
"client"))
1922 else if (
unformat (input,
"%u", &app_index))
1924 else if (
unformat (input,
"verbose"))
1931 if (do_mq && app_index != ~0)
1959 if (app_index != ~0)
1970 if (!do_server && !do_client)
2047 return (VNET_API_ERROR_INVALID_VALUE);
2086 .short_help =
"show app [app_id] [server|client] [mq] [verbose]",
2092 .path =
"show app certificate",
2093 .short_help =
"list app certs and keys present in store",
session_handle_t ls_handle
session handle of the local or global listening session that also identifies the app listener
fifo_segment_t * segment_manager_get_segment_w_lock(segment_manager_t *sm, u32 segment_index)
Reads a segment from the segment manager's pool and acquires reader lock.
int vnet_listen(vnet_listen_args_t *a)
u32 n_rings
number of msg rings
#define pool_flush(VAR, POOL, BODY)
Remove all elements from a pool in a safe way.
u8 tls_engine
Preferred tls engine.
u8 * format_cert_key_pair(u8 *s, va_list *args)
#define APP_DBG(_fmt, _args...)
enum crypto_engine_type_ crypto_engine_type_t
static vl_api_registration_t * vl_api_client_index_to_registration(u32 index)
static u32 vlib_num_workers()
u32 wrk_index
Worker index in global worker pool.
clib_file_main_t file_main
int application_change_listener_owner(session_t *s, app_worker_t *app_wrk)
svm_msg_q_t * application_rx_mq_get(application_t *app, u32 mq_index)
void ip_set(ip46_address_t *dst, void *src, u8 is_ip4)
int vnet_connect(vnet_connect_args_t *a)
static void app_rx_mqs_epoll_del(application_t *app, app_rx_mq_elt_t *mqe)
segment_manager_t * segment_manager_get(u32 index)
static clib_error_t * appliction_format_all_app_mq(vlib_main_t *vm)
int segment_manager_init_first(segment_manager_t *sm)
Initializes segment manager based on options provided.
struct app_rx_mq_elt_ * next
u8 * format_crypto_context(u8 *s, va_list *args)
const u8 * app_namespace_id_from_index(u32 index)
@ APP_OPTIONS_RX_FIFO_SIZE
u32 session_index
Index in thread pool where session was allocated.
static application_t * application_alloc(void)
@ APP_OPTIONS_HIGH_WATERMARK
void session_close(session_t *s)
Initialize session closing procedure.
session_t * app_worker_proxy_listener(app_worker_t *app, u8 fib_proto, u8 transport_proto)
#define APP_NAMESPACE_INVALID_INDEX
struct _vnet_app_worker_add_del_args vnet_app_worker_add_del_args_t
static int app_rx_mqs_alloc(application_t *app)
static void vlib_node_set_state(vlib_main_t *vm, u32 node_index, vlib_node_state_t new_state)
Set node dispatch state.
u32 local_index
local listening session index
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
int vnet_unlisten(vnet_unlisten_args_t *a)
static const u8 * app_get_name(application_t *app)
static u64 listen_session_get_handle(session_t *s)
struct _app_namespace app_namespace_t
int session_wrk_handle_mq(session_worker_t *wrk, svm_msg_q_t *mq)
static void application_name_table_add(application_t *app)
static app_cert_key_pair_t * app_cert_key_pair_alloc()
static clib_error_t * application_start_stop_proxy_fib_proto(application_t *app, u8 fib_proto, u8 transport_proto, u8 is_start)
segment_manager_props_t * segment_manager_props_init(segment_manager_props_t *props)
vlib_node_registration_t appsl_rx_mqs_input_node
(constructor) VLIB_REGISTER_NODE (appsl_rx_mqs_input_node)
int app_listener_alloc_and_init(application_t *app, session_endpoint_cfg_t *sep, app_listener_t **listener)
session_t * app_listener_get_local_session(app_listener_t *al)
static uword clib_bitmap_first_set(uword *ai)
Return the lowest numbered set bit in a bitmap.
void app_worker_format_connects(app_worker_t *app_wrk, int verbose)
u64 session_lookup_endpoint_listener(u32 table_index, session_endpoint_t *sep, u8 use_rules)
Lookup listener for session endpoint in table.
struct _segment_manager segment_manager_t
#define clib_error_return(e, args...)
struct _session_endpoint_cfg session_endpoint_cfg_t
segment_manager_props_t * application_segment_manager_properties(application_t *app)
#define hash_create_vec(elts, key_bytes, value_bytes)
static vlib_cli_command_t show_app_command
(constructor) VLIB_CLI_COMMAND (show_app_command)
void application_start_stop_proxy(application_t *app, transport_proto_t transport_proto, u8 is_start)
u32 q_nitems
msg queue size (not rings)
static u32 app_worker_map_index(application_t *app, app_worker_map_t *map)
static session_t * listen_session_get(u32 ls_index)
#define SESSION_INVALID_INDEX
u32 app_index
App index in app pool.
#define APP_INVALID_INDEX
int vnet_application_detach(vnet_app_detach_args_t *a)
Detach application from vpp.
static void application_format_connects(application_t *app, int verbose)
session_handle_t app_listen_session_handle(session_t *ls)
Get app listener handle for listening session.
app_listener_t * listeners
Pool of listeners for the app.
#define pool_put(P, E)
Free an object E in pool P.
int application_is_builtin_proxy(application_t *app)
crypto_engine_type_t last_crypto_engine
clib_error_t * application_init(vlib_main_t *vm)
int session_lookup_del_session_endpoint(u32 table_index, session_endpoint_t *sep)
vl_api_dhcp_client_state_t state
static u8 session_endpoint_is_local(session_endpoint_t *sep)
app_worker_t * app_worker_alloc(application_t *app)
int svm_msg_q_alloc_eventfd(svm_msg_q_t *mq)
Allocate event fd for queue.
struct _vnet_unlisten_args_t vnet_unlisten_args_t
u32 n_subscribers
refcount of sessions using said context
@ APP_OPTIONS_SEGMENT_SIZE
struct _vnet_app_detach_args_t vnet_app_detach_args_t
struct _transport_connection transport_connection_t
u8 * format_app_worker_listener(u8 *s, va_list *args)
int session_lookup_add_session_endpoint(u32 table_index, session_endpoint_t *sep, u64 value)
#define hash_create(elts, value_bytes)
session_t * app_worker_first_listener(app_worker_t *app, u8 fib_proto, u8 transport_proto)
app_namespace_t * app_namespace_get(u32 index)
static_always_inline void * clib_memcpy_fast(void *restrict dst, const void *restrict src, size_t n)
segment_manager_t * segment_manager_alloc(void)
void session_free(session_t *s)
@ APP_OPTIONS_NAMESPACE_SECRET
enum ssvm_segment_type_ ssvm_segment_type_t
@ APP_OPTIONS_PROXY_TRANSPORT
static app_listener_t * app_listener_alloc(application_t *app)
app_rx_mq_elt_t * rx_mqs
Fixed vector of rx mqs that can be a part of pending_rx_mqs linked list maintained by the app sublaye...
struct _vnet_shutdown_args_t vnet_shutdown_args_t
vlib_main_t vlib_node_runtime_t vlib_frame_t * frame
int(* session_accept_callback)(session_t *new_session)
Notify server of newly accepted session.
void application_format_all_clients(vlib_main_t *vm, int verbose)
u8 * format_svm_msg_q(u8 *s, va_list *args)
Format message queue, shows msg count for each ring.
#define pool_is_free_index(P, I)
Use free bitmap to query whether given index is free.
vlib_main_t vlib_node_runtime_t * node
uword * listeners_table
Lookup tables for listeners.
#define hash_set(h, key, value)
u8 application_use_private_rx_mqs(void)
#define SESSION_ENDPOINT_CFG_NULL
app_worker_t * application_get_default_worker(application_t *app)
u32 application_n_workers(application_t *app)
application_t * application_get(u32 app_index)
#define foreach_vlib_main()
static u8 svm_msg_q_is_empty(svm_msg_q_t *mq)
Check if message queue is empty.
void app_listener_cleanup(app_listener_t *al)
u32 app_wrk_index
Index of the app worker that owns the session.
u8 application_has_global_scope(application_t *app)
#define app_interface_check_thread_and_barrier(_fn, _arg)
#define pool_foreach(VAR, POOL)
Iterate through pool.
u32 app_namespace_get_fib_index(app_namespace_t *app_ns, u8 fib_proto)
void fifo_segment_cleanup(fifo_segment_t *fs)
void * ip_interface_get_first_ip(u32 sw_if_index, u8 is_ip4)
u8 app_crypto_engine_n_types(void)
svm_fifo_t * rx_fifo
Pointers to rx/tx buffers.
u32 session_index
global listening session index
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
uword * app_by_api_client_index
Hash table of apps by api client index.
svm_msg_q_t * segment_manager_event_queue(segment_manager_t *sm)
u32 app_index
owning app index
int app_worker_stop_listen(app_worker_t *app_wrk, app_listener_t *al)
u32 app_index
Index of application that owns the listener.
#define VLIB_NODE_FN(node)
struct _vnet_disconnect_args_t vnet_disconnect_args_t
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
void segment_manager_dealloc_fifos(svm_fifo_t *rx_fifo, svm_fifo_t *tx_fifo)
static void listen_session_free(session_t *s)
segment_manager_props_t * application_get_segment_manager_properties(u32 app_index)
fifo_segment_t rx_mqs_segment
Segment where rx mqs were allocated.
static app_worker_map_t * app_worker_map_get(application_t *app, u32 map_index)
transport_connection_t * session_get_transport(session_t *s)
void application_setup_proxy(application_t *app)
#define vec_dup(V)
Return copy of vector (no header, no alignment)
int session_listen(session_t *ls, session_endpoint_cfg_t *sep)
Ask transport to listen on session endpoint.
static u8 application_verify_cfg(ssvm_segment_type_t st)
Check app config for given segment type.
void ssvm_delete(ssvm_private_t *ssvm)
svm_msg_q_t * fifo_segment_msg_q_alloc(fifo_segment_t *fs, u32 mq_index, svm_msg_q_cfg_t *cfg)
Allocate message queue on segment.
struct _segment_manager_props segment_manager_props_t
int application_alloc_worker_and_init(application_t *app, app_worker_t **wrk)
#define ENDPOINT_INVALID_INDEX
static svm_msg_q_t * session_main_get_vpp_event_queue(u32 thread_index)
int vnet_app_del_cert_key_pair(u32 index)
static_always_inline uword vlib_get_thread_index(void)
An API client registration, only in vpp/vlib.
static void app_worker_map_free(application_t *app, app_worker_map_t *map)
app_worker_t * application_listener_select_worker(session_t *ls)
static u8 session_endpoint_is_zero(session_endpoint_t *sep)
u32 application_session_table(application_t *app, u8 fib_proto)
struct _vnet_bind_args_t vnet_listen_args_t
u8 * format_app_worker(u8 *s, va_list *args)
application_t * application_lookup_name(const u8 *name)
#define SESSION_TABLE_INVALID_INDEX
void application_format_all_listeners(vlib_main_t *vm, int verbose)
struct app_rx_mq_elt_ * prev
int session_stop_listen(session_t *s)
Ask transport to stop listening on local transport endpoint.
static u8 session_endpoint_fib_proto(session_endpoint_t *sep)
#define clib_bitmap_free(v)
Free a bitmap.
fifo_segment_t * application_get_rx_mqs_segment(application_t *app)
app_rx_mq_elt_t * pending_rx_mqs
Linked list of mqs with pending messages.
void(* session_disconnect_callback)(session_t *s)
Notify app that session is closing.
void segment_manager_segment_reader_unlock(segment_manager_t *sm)
uword * app_by_name
Hash table of builtin apps by name.
static u8 vlib_thread_is_main_w_barrier(void)
#define hash_set_mem(h, key, value)
app_cert_key_pair_t * cert_key_pair_store
Pool from which we allocate certificates (key, cert)
#define hash_foreach(key_var, value_var, h, body)
void appsl_pending_rx_mqs_del(appsl_wrk_t *aw, app_rx_mq_elt_t *elt)
u8 application_has_local_scope(application_t *app)
session_main_t session_main
static void application_free(application_t *app)
static u32 session_index_from_handle(session_handle_t handle)
sll srl srl sll sra u16x4 i
static void app_listener_free(application_t *app, app_listener_t *app_listener)
static void application_api_table_del(u32 api_client_index)
static session_handle_t session_handle(session_t *s)
svm_msg_q_ring_cfg_t * ring_cfgs
array of ring cfgs
u32 ns_index
Namespace the application belongs to.
u64 segment_manager_segment_handle(segment_manager_t *sm, fifo_segment_t *segment)
#define pool_get(P, E)
Allocate an object E from a pool P (unspecified alignment).
static session_t * session_get_from_handle(session_handle_t handle)
static session_t * session_get_from_handle_if_valid(session_handle_t handle)
#define vec_validate(V, I)
Make sure vector is long enough for given index (no header, unspecified alignment)
#define VLIB_CLI_COMMAND(x,...)
void(* session_reset_callback)(session_t *s)
Notify app that session was reset.
u8 use_private_rx_mqs
Allocate private rx mqs for external apps.
enum fib_protocol_t_ fib_protocol_t
Protocol Type.
static void application_api_table_add(u32 app_index, u32 api_client_index)
static uword * clib_bitmap_set(uword *ai, uword i, uword value)
Sets the ith bit of a bitmap to new_value Removes trailing zeros from the bitmap.
svm_msg_q_t * event_queue
Application listens for events on this svm queue.
application_t * application_get_if_valid(u32 app_index)
app_cert_key_pair_t * app_cert_key_pair_get_default()
int vnet_app_add_cert_key_pair(vnet_app_add_cert_key_pair_args_t *a)
static app_worker_map_t * app_worker_map_alloc(application_t *app)
struct _vlib_node_registration vlib_node_registration_t
u32 segment_manager_index(segment_manager_t *sm)
static session_t * session_get(u32 si, u32 thread_index)
int vnet_disconnect_session(vnet_disconnect_args_t *a)
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)
#define vec_search(v, E)
Search a vector for the index of the entry that matches.
struct _vnet_app_add_cert_key_pair_args_ vnet_app_add_cert_key_pair_args_t
int app_worker_connect_session(app_worker_t *app, session_endpoint_cfg_t *sep, session_handle_t *rsh)
int application_is_proxy(application_t *app)
@ APP_OPTIONS_PREALLOC_FIFO_PAIRS
app_listener_t * app_listener_get_w_handle(session_handle_t handle)
Get app listener for listener session handle.
static session_type_t session_type_from_proto_and_ip(transport_proto_t proto, u8 is_ip4)
uword svm_msg_q_size_to_alloc(svm_msg_q_cfg_t *cfg)
int vnet_application_attach(vnet_app_attach_args_t *a)
Attach application to vpp.
void app_worker_free(app_worker_t *app_wrk)
static uword hash_elts(void *v)
crypto_engine_type_t app_crypto_engine_type_add(void)
static clib_error_t * show_app_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
u32 application_local_session_table(application_t *app)
static app_worker_t * app_listener_select_worker(application_t *app, app_listener_t *al)
clib_bitmap_t * workers
workers accepting connections
ssvm_private_t ssvm
ssvm segment data
static u8 * app_name_from_api_index(u32 api_client_index)
#define vec_free(V)
Free vector's memory (no header).
app_cert_key_pair_t * app_cert_key_pair_get(u32 index)
static int app_validate_namespace(u8 *namespace_id, u64 secret, u32 *app_ns_index)
u32 ctx_index
index in crypto context pool
@ APP_OPTIONS_TX_FIFO_SIZE
#define SESSION_ENDPOINT_NULL
u32 connects_seg_manager
Segment manager used for outgoing connects issued by the app.
@ TRANSPORT_CONNECTION_F_NO_LOOKUP
Don't register connection in lookup.
#define hash_get_mem(h, key)
fifo_segment_t * session_main_get_evt_q_segment(void)
#define transport_proto_foreach(VAR, BODY)
application_t * application_lookup(u32 api_client_index)
App sublayer per vpp worker state.
@ APP_OPTIONS_ADD_SEGMENT_SIZE
app_worker_map_t * worker_maps
Pool of mappings that keep track of workers associated to this app.
static void application_verify_cb_fns(session_cb_vft_t *cb_fns)
description fragment has unexpected format
int ssvm_server_init(ssvm_private_t *ssvm, ssvm_segment_type_t type)
u32 app_namespace_index_from_id(const u8 *ns_id)
segment_manager_props_t sm_properties
Segment manager properties.
format_function_t format_ip46_address
appsl_wrk_t * wrk
App sublayer per-worker state.
#define VLIB_INIT_FUNCTION(x)
transport_connection_t * listen_session_get_transport(session_t *s)
u8 ip_is_local(u32 fib_index, ip46_address_t *ip46_address, u8 is_ip4)
Checks that an ip is local to the requested fib.
void ip_copy(ip46_address_t *dst, ip46_address_t *src, u8 is_ip4)
static struct option options[]
static void vlib_node_set_interrupt_pending(vlib_main_t *vm, u32 node_index)
enum _transport_proto transport_proto_t
app_worker_t * app_worker_get(u32 wrk_index)
u8 * format_crypto_engine(u8 *s, va_list *args)
static void app_rx_mqs_epoll_add(application_t *app, app_rx_mq_elt_t *mqe)
#define vec_foreach(var, vec)
Vector iterator.
@ APP_OPTIONS_EVT_QUEUE_SIZE
static session_t * listen_session_alloc(u8 thread_index, session_type_t type)
void session_half_close(session_t *s)
Initialize session half-closing procedure.
int vnet_shutdown_session(vnet_shutdown_args_t *a)
app_worker_t * application_get_worker(application_t *app, u32 wrk_map_index)
u8 * format_application(u8 *s, va_list *args)
static void application_name_table_del(application_t *app)
struct _session_endpoint session_endpoint_t
struct _vnet_connect_args vnet_connect_args_t
static uword pool_elts(void *v)
Number of active elements in a pool.
u8 ip_interface_has_address(u32 sw_if_index, ip46_address_t *ip, u8 is_ip4)
static uword clib_file_add(clib_file_main_t *um, clib_file_t *template)
const u8 * application_name_from_index(u32 app_index)
Returns app name for app-index.
static clib_error_t * show_certificate_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
#define SESSION_INVALID_HANDLE
int(* session_connected_callback)(u32 app_wrk_index, u32 opaque, session_t *s, session_error_t code)
Connection request callback.
@ TRANSPORT_SERVICE_CL
connectionless service
#define hash_unset(h, key)
int vnet_app_worker_add_del(vnet_app_worker_add_del_args_t *a)
int fifo_segment_init(fifo_segment_t *fs)
Initialize fifo segment shared header.
int consumer_pid
pid of msg consumer
static void application_format_listeners(application_t *app, int verbose)
static int application_alloc_and_init(app_init_args_t *a)
void application_remove_proxy(application_t *app)
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
static u32 vlib_get_n_threads()
appsl_rx_mqs_input_node index
u32 wrk_map_index
Worker index in app's map pool.
static void application_start_stop_proxy_local_scope(application_t *app, u8 transport_proto, u8 is_start)
static void appliction_format_app_mq(vlib_main_t *vm, application_t *app)
static vlib_main_t * vlib_get_main(void)
static transport_service_type_t session_transport_service_type(session_t *s)
#define hash_unset_mem(h, key)
static clib_error_t * app_rx_mq_fd_write_ready(clib_file_t *cf)
clib_error_t *() vlib_init_function_t(struct vlib_main_t *vm)
void ct_session_endpoint(session_t *ll, session_endpoint_t *sep)
void application_enable_rx_mqs_nodes(u8 is_en)
#define pool_free(p)
Free a pool.
application_t * app_pool
Pool from which we allocate all applications.
#define clib_warning(format, args...)
static void clib_file_del_by_index(clib_file_main_t *um, uword index)
app_cert_key_pair_t * app_cert_key_pair_get_if_valid(u32 index)
session_cb_vft_t cb_fns
Callbacks: shoulder-taps for the server/client.
@ APP_OPTIONS_PREALLOC_FIFO_HDRS
u8 * name
Name registered by builtin apps.
app_listener_t * app_listener_get_w_session(session_t *ls)
struct _vnet_app_attach_args_t vnet_app_attach_args_t
@ APP_OPTIONS_PCT_FIRST_ALLOC
u32 app_index
Index of owning app.
u32 al_index
App listener index in app's listener pool if a listener.
session_wrk_state_t state
Worker state.
#define session_cli_return_if_not_enabled()
static app_main_t app_main
int(* app_cert_key_pair_delete_callback)(app_cert_key_pair_t *ckpair)
Cert and key pair delete notification.
fifo_segment_header_t * h
fifo segment data
app_listener_t * app_listener_get(application_t *app, u32 app_listener_index)
vlib_node_registration_t session_queue_node
(constructor) VLIB_REGISTER_NODE (session_queue_node)
static void session_endpoint_update_for_app(session_endpoint_cfg_t *sep, application_t *app, u8 is_connect)
session_handle_t app_listener_handle(app_listener_t *al)
u32 api_client_index
API index for the worker.
u32 ckpair_index
certificate & key
int application_is_builtin(application_t *app)
u32 session_lookup_get_index_for_fib(u32 fib_proto, u32 fib_index)
int app_worker_start_listen(app_worker_t *app_wrk, app_listener_t *lstnr)
@ APP_OPTIONS_MAX_FIFO_SIZE
session_t * app_listener_get_session(app_listener_t *al)
static clib_error_t * app_rx_mq_fd_read_ready(clib_file_t *cf)
static session_worker_t * session_main_get_worker(u32 thread_index)
app_listener_t * app_listener_lookup(application_t *app, session_endpoint_cfg_t *sep_ext)
u32 al_index
app listener index in app pool
int vnet_app_add_cert_key_interest(u32 index, u32 app_index)
Ask for app cb on pair deletion.
static session_t * listen_session_get_from_handle(session_handle_t handle)
void appsl_pending_rx_mqs_add_tail(appsl_wrk_t *aw, app_rx_mq_elt_t *elt)
uword unformat_crypto_engine(unformat_input_t *input, va_list *args)
@ APP_OPTIONS_LOW_WATERMARK
static vlib_cli_command_t show_certificate_command
(constructor) VLIB_CLI_COMMAND (show_certificate_command)
static u8 session_endpoint_in_ns(session_endpoint_t *sep)
static int svm_msg_q_get_eventfd(svm_msg_q_t *mq)
static void application_detach_process(application_t *app, u32 api_client_index)
#define VLIB_REGISTER_NODE(x,...)
u8 ip_is_zero(ip46_address_t *ip46_address, u8 is_ip4)
u32 accept_rotor
last worker to accept a connection
vl_api_wireguard_peer_flags_t flags