FD.io VPP  v18.11-rc0-18-g2a3fb1a
Vector Packet Processing
application.c File Reference
+ Include dependency graph for application.c:

Go to the source code of this file.

Typedefs

typedef int( app_send_evt_handler_fn) (application_t *app, stream_session_t *s, u8 lock)
 

Functions

static u8app_get_name_from_reg_index (application_t *app)
 
static u8app_get_name (application_t *app)
 
u32 application_session_table (application_t *app, u8 fib_proto)
 
u32 application_local_session_table (application_t *app)
 
int application_api_queue_is_full (application_t *app)
 
u8application_name_from_index (u32 app_index)
 Returns app name. More...
 
static void application_table_add (application_t *app)
 
static void application_table_del (application_t *app)
 
application_tapplication_lookup (u32 api_client_index)
 
application_tapplication_lookup_name (const u8 *name)
 
application_tapplication_new ()
 
void application_del (application_t *app)
 
static void application_verify_cb_fns (session_cb_vft_t *cb_fns)
 
static u8 application_verify_cfg (ssvm_segment_type_t st)
 Check app config for given segment type. More...
 
int application_init (application_t *app, u32 api_client_index, u8 *app_name, u64 *options, session_cb_vft_t *cb_fns)
 
application_tapplication_get (u32 index)
 
application_tapplication_get_if_valid (u32 index)
 
u32 application_get_index (application_t *app)
 
static segment_manager_tapplication_alloc_segment_manager (application_t *app)
 
int application_start_listen (application_t *srv, session_endpoint_t *sep, session_handle_t *res)
 Start listening local transport endpoint for requested transport. More...
 
int application_stop_listen (application_t *srv, session_handle_t handle)
 Stop listening on session associated to handle. More...
 
int application_open_session (application_t *app, session_endpoint_t *sep, u32 api_context)
 
int application_alloc_connects_segment_manager (application_t *app)
 
segment_manager_tapplication_get_connect_segment_manager (application_t *app)
 
segment_manager_tapplication_get_listen_segment_manager (application_t *app, stream_session_t *s)
 
segment_manager_tapplication_get_local_segment_manager (application_t *app)
 
segment_manager_tapplication_get_local_segment_manager_w_session (application_t *app, local_session_t *ls)
 
int application_is_proxy (application_t *app)
 
int application_is_builtin (application_t *app)
 
int application_is_builtin_proxy (application_t *app)
 
int application_add_segment_notify (u32 app_index, ssvm_private_t *fs)
 Send an API message to the external app, to map new segment. More...
 
u8 application_has_local_scope (application_t *app)
 
u8 application_has_global_scope (application_t *app)
 
u32 application_n_listeners (application_t *app)
 
stream_session_tapplication_first_listener (application_t *app, u8 fib_proto, u8 transport_proto)
 
stream_session_tapplication_proxy_listener (application_t *app, u8 fib_proto, u8 transport_proto)
 
static clib_error_tapplication_start_stop_proxy_fib_proto (application_t *app, u8 fib_proto, u8 transport_proto, u8 is_start)
 
static void application_start_stop_proxy_local_scope (application_t *app, u8 transport_proto, u8 is_start)
 
void application_start_stop_proxy (application_t *app, transport_proto_t transport_proto, u8 is_start)
 
void application_setup_proxy (application_t *app)
 
void application_remove_proxy (application_t *app)
 
segment_manager_properties_tapplication_segment_manager_properties (application_t *app)
 
segment_manager_properties_tapplication_get_segment_manager_properties (u32 app_index)
 
static int app_enqueue_evt (svm_msg_q_t *mq, svm_msg_q_msg_t *msg, u8 lock)
 
static int app_send_io_evt_rx (application_t *app, stream_session_t *s, u8 lock)
 
static int app_send_io_evt_tx (application_t *app, stream_session_t *s, u8 lock)
 
int application_send_event (application_t *app, stream_session_t *s, u8 evt_type)
 Send event to application. More...
 
int application_lock_and_send_event (application_t *app, stream_session_t *s, u8 evt_type)
 
local_session_tapplication_alloc_local_session (application_t *app)
 
void application_free_local_session (application_t *app, local_session_t *s)
 
local_session_tapplication_get_local_session (application_t *app, u32 session_index)
 
local_session_tapplication_get_local_session_from_handle (session_handle_t handle)
 
static void application_local_listener_session_endpoint (local_session_t *ll, session_endpoint_t *sep)
 
int application_start_local_listen (application_t *server, session_endpoint_t *sep, session_handle_t *handle)
 
int application_stop_local_listen (application_t *server, session_handle_t lh)
 Clean up local session table. More...
 
int application_local_session_connect (u32 table_index, application_t *client, application_t *server, local_session_t *ll, u32 opaque)
 
static uword application_client_local_connect_key (local_session_t *ls)
 
static void application_client_local_connect_key_parse (uword key, u32 *app_index, u32 *session_index)
 
int application_local_session_connect_notify (local_session_t *ls)
 
int application_local_session_cleanup (application_t *client, application_t *server, local_session_t *ls)
 
int application_local_session_disconnect (u32 app_index, local_session_t *ls)
 
int application_local_session_disconnect_w_index (u32 app_index, u32 ls_index)
 
void application_local_sessions_del (application_t *app)
 
clib_error_tvnet_app_add_tls_cert (vnet_app_add_tls_cert_args_t *a)
 
clib_error_tvnet_app_add_tls_key (vnet_app_add_tls_key_args_t *a)
 
u8format_application_listener (u8 *s, va_list *args)
 
void application_format_connects (application_t *app, int verbose)
 
void application_format_local_sessions (application_t *app, int verbose)
 
void application_format_local_connects (application_t *app, int verbose)
 
u8format_application (u8 *s, va_list *args)
 
void application_format_all_listeners (vlib_main_t *vm, int do_local, int verbose)
 
void application_format_all_clients (vlib_main_t *vm, int do_local, int verbose)
 
static clib_error_tshow_app_command_fn (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 

Variables

static application_tapp_pool
 Pool from which we allocate all applications. More...
 
static uwordapp_by_api_client_index
 Hash table of apps by api client index. More...
 
static uwordapp_by_name
 Hash table of builtin apps by name. More...
 
static app_send_evt_handler_fn *const app_send_evt_handler_fns [2]
 
static vlib_cli_command_t show_app_command
 (constructor) VLIB_CLI_COMMAND (show_app_command) More...
 

Typedef Documentation

typedef int( app_send_evt_handler_fn) (application_t *app, stream_session_t *s, u8 lock)

Definition at line 914 of file application.c.

Function Documentation

static int app_enqueue_evt ( svm_msg_q_t mq,
svm_msg_q_msg_t msg,
u8  lock 
)
inlinestatic

Definition at line 811 of file application.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static u8* app_get_name ( application_t app)
static

Definition at line 52 of file application.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static u8* app_get_name_from_reg_index ( application_t app)
static

Definition at line 37 of file application.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static int app_send_io_evt_rx ( application_t app,
stream_session_t s,
u8  lock 
)
inlinestatic

Definition at line 838 of file application.c.

+ Here is the call graph for this function:

static int app_send_io_evt_tx ( application_t app,
stream_session_t s,
u8  lock 
)
inlinestatic

Definition at line 882 of file application.c.

+ Here is the call graph for this function:

int application_add_segment_notify ( u32  app_index,
ssvm_private_t fs 
)

Send an API message to the external app, to map new segment.

Definition at line 600 of file application.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int application_alloc_connects_segment_manager ( application_t app)

Definition at line 528 of file application.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

local_session_t* application_alloc_local_session ( application_t app)

Definition at line 946 of file application.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static segment_manager_t* application_alloc_segment_manager ( application_t app)
static

Definition at line 409 of file application.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int application_api_queue_is_full ( application_t app)

Definition at line 85 of file application.c.

+ Here is the call graph for this function:

static uword application_client_local_connect_key ( local_session_t ls)
static

Definition at line 1169 of file application.c.

+ Here is the caller graph for this function:

static void application_client_local_connect_key_parse ( uword  key,
u32 app_index,
u32 session_index 
)
static

Definition at line 1175 of file application.c.

+ Here is the caller graph for this function:

void application_del ( application_t app)

Definition at line 173 of file application.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

stream_session_t* application_first_listener ( application_t app,
u8  fib_proto,
u8  transport_proto 
)

Definition at line 625 of file application.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void application_format_all_clients ( vlib_main_t vm,
int  do_local,
int  verbose 
)

Definition at line 1643 of file application.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void application_format_all_listeners ( vlib_main_t vm,
int  do_local,
int  verbose 
)

Definition at line 1600 of file application.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void application_format_connects ( application_t app,
int  verbose 
)

Definition at line 1429 of file application.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void application_format_local_connects ( application_t app,
int  verbose 
)

Definition at line 1530 of file application.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void application_format_local_sessions ( application_t app,
int  verbose 
)

Definition at line 1493 of file application.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void application_free_local_session ( application_t app,
local_session_t s 
)

Definition at line 958 of file application.c.

+ Here is the caller graph for this function:

application_t* application_get ( u32  index)

Definition at line 386 of file application.c.

+ Here is the caller graph for this function:

segment_manager_t* application_get_connect_segment_manager ( application_t app)

Definition at line 543 of file application.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

application_t* application_get_if_valid ( u32  index)

Definition at line 394 of file application.c.

+ Here is the caller graph for this function:

u32 application_get_index ( application_t app)

Definition at line 403 of file application.c.

+ Here is the caller graph for this function:

segment_manager_t* application_get_listen_segment_manager ( application_t app,
stream_session_t s 
)

Definition at line 550 of file application.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

segment_manager_t* application_get_local_segment_manager ( application_t app)

Definition at line 560 of file application.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

segment_manager_t* application_get_local_segment_manager_w_session ( application_t app,
local_session_t ls 
)

Definition at line 566 of file application.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

local_session_t* application_get_local_session ( application_t app,
u32  session_index 
)

Definition at line 966 of file application.c.

+ Here is the caller graph for this function:

local_session_t* application_get_local_session_from_handle ( session_handle_t  handle)

Definition at line 972 of file application.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

segment_manager_properties_t* application_get_segment_manager_properties ( u32  app_index)

Definition at line 804 of file application.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

u8 application_has_global_scope ( application_t app)

Definition at line 613 of file application.c.

+ Here is the caller graph for this function:

u8 application_has_local_scope ( application_t app)

Definition at line 607 of file application.c.

+ Here is the caller graph for this function:

int application_init ( application_t app,
u32  api_client_index,
u8 app_name,
u64 options,
session_cb_vft_t cb_fns 
)

Definition at line 291 of file application.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int application_is_builtin ( application_t app)

Definition at line 585 of file application.c.

+ Here is the caller graph for this function:

int application_is_builtin_proxy ( application_t app)

Definition at line 591 of file application.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int application_is_proxy ( application_t app)

Definition at line 579 of file application.c.

+ Here is the caller graph for this function:

static void application_local_listener_session_endpoint ( local_session_t ll,
session_endpoint_t sep 
)
inlinestatic

Definition at line 982 of file application.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int application_local_session_cleanup ( application_t client,
application_t server,
local_session_t ls 
)

Definition at line 1219 of file application.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int application_local_session_connect ( u32  table_index,
application_t client,
application_t server,
local_session_t ll,
u32  opaque 
)

Definition at line 1077 of file application.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int application_local_session_connect_notify ( local_session_t ls)

Definition at line 1183 of file application.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int application_local_session_disconnect ( u32  app_index,
local_session_t ls 
)

Definition at line 1256 of file application.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int application_local_session_disconnect_w_index ( u32  app_index,
u32  ls_index 
)

Definition at line 1297 of file application.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

u32 application_local_session_table ( application_t app)

Definition at line 75 of file application.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void application_local_sessions_del ( application_t app)

Definition at line 1307 of file application.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int application_lock_and_send_event ( application_t app,
stream_session_t s,
u8  evt_type 
)

Definition at line 939 of file application.c.

+ Here is the caller graph for this function:

application_t* application_lookup ( u32  api_client_index)

Definition at line 136 of file application.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

application_t* application_lookup_name ( const u8 name)

Definition at line 147 of file application.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

u32 application_n_listeners ( application_t app)

Definition at line 619 of file application.c.

+ Here is the call graph for this function:

u8* application_name_from_index ( u32  app_index)

Returns app name.

Since the name is not stored per app, we generate it on the fly. It is the caller's responsibility to free the vector

Definition at line 109 of file application.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

application_t* application_new ( )

Definition at line 158 of file application.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int application_open_session ( application_t app,
session_endpoint_t sep,
u32  api_context 
)

Definition at line 513 of file application.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

stream_session_t* application_proxy_listener ( application_t app,
u8  fib_proto,
u8  transport_proto 
)

Definition at line 649 of file application.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void application_remove_proxy ( application_t app)

Definition at line 782 of file application.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

segment_manager_properties_t* application_segment_manager_properties ( application_t app)

Definition at line 798 of file application.c.

+ Here is the caller graph for this function:

int application_send_event ( application_t app,
stream_session_t s,
u8  evt_type 
)

Send event to application.

Logic from queue perspective is non-blocking. That is, if there's not enough space to enqueue a message, we return. However, if the lock flag is set, we do wait for queue mutex.

Definition at line 931 of file application.c.

+ Here is the caller graph for this function:

u32 application_session_table ( application_t app,
u8  fib_proto 
)

Definition at line 60 of file application.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void application_setup_proxy ( application_t app)

Definition at line 766 of file application.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int application_start_listen ( application_t srv,
session_endpoint_t sep,
session_handle_t res 
)

Start listening local transport endpoint for requested transport.

Creates a 'dummy' stream session with state LISTENING to be used in session lookups, prior to establishing connection. Requests transport to build it's own specific listening connection.

Definition at line 436 of file application.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int application_start_local_listen ( application_t server,
session_endpoint_t sep,
session_handle_t handle 
)

Definition at line 992 of file application.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void application_start_stop_proxy ( application_t app,
transport_proto_t  transport_proto,
u8  is_start 
)

Definition at line 750 of file application.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static clib_error_t* application_start_stop_proxy_fib_proto ( application_t app,
u8  fib_proto,
u8  transport_proto,
u8  is_start 
)
static

Definition at line 673 of file application.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void application_start_stop_proxy_local_scope ( application_t app,
u8  transport_proto,
u8  is_start 
)
static

Definition at line 723 of file application.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int application_stop_listen ( application_t srv,
session_handle_t  handle 
)

Stop listening on session associated to handle.

Definition at line 477 of file application.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int application_stop_local_listen ( application_t server,
session_handle_t  lh 
)

Clean up local session table.

If we have a listener session use it to find the port and proto. If not, the handle must be a local table handle so parse it.

Definition at line 1030 of file application.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void application_table_add ( application_t app)
static

Definition at line 118 of file application.c.

+ Here is the caller graph for this function:

static void application_table_del ( application_t app)
static

Definition at line 127 of file application.c.

+ Here is the caller graph for this function:

static void application_verify_cb_fns ( session_cb_vft_t cb_fns)
static

Definition at line 251 of file application.c.

+ Here is the caller graph for this function:

static u8 application_verify_cfg ( ssvm_segment_type_t  st)
static

Check app config for given segment type.

Returns 1 on success and 0 otherwise

Definition at line 269 of file application.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

u8* format_application ( u8 s,
va_list *  args 
)

Definition at line 1563 of file application.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

u8* format_application_listener ( u8 s,
va_list *  args 
)

Definition at line 1392 of file application.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static clib_error_t* show_app_command_fn ( vlib_main_t vm,
unformat_input_t input,
vlib_cli_command_t cmd 
)
static

Definition at line 1679 of file application.c.

+ Here is the call graph for this function:

clib_error_t* vnet_app_add_tls_cert ( vnet_app_add_tls_cert_args_t a)

Definition at line 1368 of file application.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

clib_error_t* vnet_app_add_tls_key ( vnet_app_add_tls_key_args_t a)

Definition at line 1380 of file application.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Variable Documentation

uword* app_by_api_client_index
static

Hash table of apps by api client index.

Definition at line 29 of file application.c.

uword* app_by_name
static

Hash table of builtin apps by name.

Definition at line 34 of file application.c.

application_t* app_pool
static

Pool from which we allocate all applications.

Definition at line 24 of file application.c.

app_send_evt_handler_fn* const app_send_evt_handler_fns[2]
static
Initial value:
= {
}
static int app_send_io_evt_rx(application_t *app, stream_session_t *s, u8 lock)
Definition: application.c:838
static int app_send_io_evt_tx(application_t *app, stream_session_t *s, u8 lock)
Definition: application.c:882

Definition at line 917 of file application.c.

vlib_cli_command_t show_app_command
static
Initial value:
=
{
.path = "show app",
.short_help = "show app [server|client] [verbose]",
.function = show_app_command_fn,
}
static clib_error_t * show_app_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: application.c:1679

(constructor) VLIB_CLI_COMMAND (show_app_command)

Definition at line 1723 of file application.c.