FD.io VPP  v19.01.3-6-g70449b9b9
Vector Packet Processing
application.h File Reference
+ Include dependency graph for application.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  app_worker_
 
struct  app_worker_map_
 
struct  app_listener_
 
struct  application_
 
struct  app_main_
 
struct  app_init_args_
 

Macros

#define APP_DEBUG   0
 
#define APP_DBG(_fmt, _args...)
 
#define foreach_app_init_args
 
#define APP_INVALID_INDEX   ((u32)~0)
 
#define APP_NS_INVALID_INDEX   ((u32)~0)
 
#define APP_INVALID_SEGMENT_MANAGER_INDEX   ((u32) ~0)
 

Typedefs

typedef struct _stream_session_cb_vft session_cb_vft_t
 
typedef struct app_worker_ app_worker_t
 
typedef struct app_worker_map_ app_worker_map_t
 
typedef struct app_listener_ app_listener_t
 
typedef struct application_ application_t
 
typedef struct app_main_ app_main_t
 
typedef struct app_init_args_ app_init_args_t
 
typedef struct _vnet_app_worker_add_del_args vnet_app_worker_add_del_args_t
 

Functions

app_worker_tapp_worker_alloc (application_t *app)
 
int app_worker_alloc_and_init (application_t *app, app_worker_t **wrk)
 
app_worker_tapp_worker_get (u32 wrk_index)
 
app_worker_tapp_worker_get_if_valid (u32 wrk_index)
 
application_tapp_worker_get_app (u32 wrk_index)
 
int app_worker_own_session (app_worker_t *app_wrk, stream_session_t *s)
 
void app_worker_free (app_worker_t *app_wrk)
 
int app_worker_open_session (app_worker_t *app, session_endpoint_t *tep, u32 api_context)
 
segment_manager_tapp_worker_get_listen_segment_manager (app_worker_t *, stream_session_t *)
 
segment_manager_tapp_worker_get_connect_segment_manager (app_worker_t *)
 
segment_manager_tapp_worker_get_or_alloc_connect_segment_manager (app_worker_t *)
 
int app_worker_alloc_connects_segment_manager (app_worker_t *app)
 
int app_worker_add_segment_notify (u32 app_or_wrk, u64 segment_handle)
 Send an API message to the external app, to map new segment. More...
 
u32 app_worker_n_listeners (app_worker_t *app)
 
stream_session_tapp_worker_first_listener (app_worker_t *app, u8 fib_proto, u8 transport_proto)
 
u8 app_worker_application_is_builtin (app_worker_t *app_wrk)
 
int app_worker_send_event (app_worker_t *app, stream_session_t *s, u8 evt)
 Send event to application. More...
 
int app_worker_lock_and_send_event (app_worker_t *app, stream_session_t *s, u8 evt_type)
 Send event to application. More...
 
clib_error_tvnet_app_worker_add_del (vnet_app_worker_add_del_args_t *a)
 
int application_start_listen (application_t *app, session_endpoint_cfg_t *tep, session_handle_t *handle)
 Start listening local transport endpoint for requested transport. More...
 
int application_stop_listen (u32 app_index, u32 app_or_wrk, session_handle_t handle)
 Stop listening on session associated to handle. More...
 
application_tapplication_alloc (void)
 
int application_alloc_and_init (app_init_args_t *args)
 
void application_free (application_t *app)
 
void application_detach_process (application_t *app, u32 api_client_index)
 
application_tapplication_get (u32 index)
 
application_tapplication_get_if_valid (u32 index)
 
application_tapplication_lookup (u32 api_client_index)
 
application_tapplication_lookup_name (const u8 *name)
 
app_worker_tapplication_get_worker (application_t *app, u32 wrk_index)
 
app_worker_tapplication_get_default_worker (application_t *app)
 
app_worker_tapplication_listener_select_worker (stream_session_t *ls, u8 is_local)
 
int application_is_proxy (application_t *app)
 
int application_is_builtin (application_t *app)
 
int application_is_builtin_proxy (application_t *app)
 
u32 application_session_table (application_t *app, u8 fib_proto)
 
u32 application_local_session_table (application_t *app)
 
const u8application_name_from_index (u32 app_or_wrk)
 Returns app name for app-index. More...
 
u8 application_has_local_scope (application_t *app)
 
u8 application_has_global_scope (application_t *app)
 
u8 application_use_mq_for_ctrl (application_t *app)
 
void application_setup_proxy (application_t *app)
 
void application_remove_proxy (application_t *app)
 
segment_manager_properties_tapplication_get_segment_manager_properties (u32 app_index)
 
segment_manager_properties_tapplication_segment_manager_properties (application_t *app)
 
local_session_tapplication_local_session_alloc (app_worker_t *app)
 
void application_local_session_free (app_worker_t *app, local_session_t *ls)
 
local_session_tapplication_get_local_session (app_worker_t *app, u32 session_index)
 
local_session_tapplication_get_local_session_from_handle (session_handle_t handle)
 
local_session_tapplication_get_local_listen_session_from_handle (session_handle_t lh)
 
int application_start_local_listen (application_t *server, session_endpoint_cfg_t *sep, session_handle_t *handle)
 
int application_stop_local_listen (u32 app_index, u32 app_or_wrk, session_handle_t lh)
 Clean up local session table. More...
 
int application_local_session_connect (app_worker_t *client, app_worker_t *server, local_session_t *ls, u32 opaque)
 
int application_local_session_connect_notify (local_session_t *ls)
 
int application_local_session_disconnect (u32 app_or_wrk, local_session_t *ls)
 
int application_local_session_disconnect_w_index (u32 app_or_wrk, u32 ls_index)
 
void app_worker_local_sessions_free (app_worker_t *app)
 
static u32 local_session_id (local_session_t *ls)
 
static void local_session_parse_id (u32 ls_id, u32 *app_or_wrk, u32 *session_index)
 
static void local_session_parse_handle (session_handle_t handle, u32 *app_or_wrk_index, u32 *session_index)
 
static session_handle_t application_local_session_handle (local_session_t *ls)
 
static local_session_tapplication_get_local_listen_session (application_t *app, u32 session_index)
 
static local_session_tapplication_get_local_listener_w_handle (session_handle_t handle)
 
static u8 application_local_session_listener_has_transport (local_session_t *ls)
 
void mq_send_local_session_disconnected_cb (u32 app_or_wrk, local_session_t *ls)
 
uword unformat_application_proto (unformat_input_t *input, va_list *args)
 

Macro Definition Documentation

◆ APP_DBG

#define APP_DBG (   _fmt,
  _args... 
)

Definition at line 28 of file application.h.

◆ APP_DEBUG

#define APP_DEBUG   0

Definition at line 23 of file application.h.

◆ APP_INVALID_INDEX

#define APP_INVALID_INDEX   ((u32)~0)

Definition at line 219 of file application.h.

◆ APP_INVALID_SEGMENT_MANAGER_INDEX

#define APP_INVALID_SEGMENT_MANAGER_INDEX   ((u32) ~0)

Definition at line 221 of file application.h.

◆ APP_NS_INVALID_INDEX

#define APP_NS_INVALID_INDEX   ((u32)~0)

Definition at line 220 of file application.h.

◆ foreach_app_init_args

#define foreach_app_init_args
Value:
_(u32, api_client_index) \
_(u8 *, name) \
_(u64 *, options) \
_(u8 *, namespace_id) \
_(u32, app_index) \
unsigned long u64
Definition: types.h:89
unsigned char u8
Definition: types.h:56
struct _stream_session_cb_vft session_cb_vft_t
unsigned int u32
Definition: types.h:88
static session_cb_vft_t session_cb_vft
Definition: session_api.c:389
u8 name[64]
Definition: memclnt.api:152

Definition at line 193 of file application.h.

Typedef Documentation

◆ app_init_args_t

◆ app_listener_t

typedef struct app_listener_ app_listener_t

◆ app_main_t

typedef struct app_main_ app_main_t

◆ app_worker_map_t

◆ app_worker_t

typedef struct app_worker_ app_worker_t

◆ application_t

typedef struct application_ application_t

◆ session_cb_vft_t

typedef struct _stream_session_cb_vft session_cb_vft_t

◆ vnet_app_worker_add_del_args_t

typedef struct _vnet_app_worker_add_del_args vnet_app_worker_add_del_args_t

Function Documentation

◆ app_worker_add_segment_notify()

int app_worker_add_segment_notify ( u32  app_or_wrk,
u64  segment_handle 
)

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

Definition at line 1063 of file application.c.

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

◆ app_worker_alloc()

app_worker_t* app_worker_alloc ( application_t app)

Definition at line 501 of file application.c.

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

◆ app_worker_alloc_and_init()

int app_worker_alloc_and_init ( application_t app,
app_worker_t **  wrk 
)

Definition at line 597 of file application.c.

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

◆ app_worker_alloc_connects_segment_manager()

int app_worker_alloc_connects_segment_manager ( app_worker_t app)

Definition at line 913 of file application.c.

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

◆ app_worker_application_is_builtin()

u8 app_worker_application_is_builtin ( app_worker_t app_wrk)

Definition at line 1102 of file application.c.

+ Here is the caller graph for this function:

◆ app_worker_first_listener()

stream_session_t* app_worker_first_listener ( app_worker_t app,
u8  fib_proto,
u8  transport_proto 
)

Definition at line 1078 of file application.c.

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

◆ app_worker_free()

void app_worker_free ( app_worker_t app_wrk)

Definition at line 531 of file application.c.

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

◆ app_worker_get()

app_worker_t* app_worker_get ( u32  wrk_index)

Definition at line 517 of file application.c.

+ Here is the caller graph for this function:

◆ app_worker_get_app()

application_t* app_worker_get_app ( u32  wrk_index)

Definition at line 645 of file application.c.

+ Here is the call graph for this function:

◆ app_worker_get_connect_segment_manager()

segment_manager_t* app_worker_get_connect_segment_manager ( app_worker_t )

Definition at line 928 of file application.c.

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

◆ app_worker_get_if_valid()

app_worker_t* app_worker_get_if_valid ( u32  wrk_index)

Definition at line 523 of file application.c.

+ Here is the caller graph for this function:

◆ app_worker_get_listen_segment_manager()

segment_manager_t* app_worker_get_listen_segment_manager ( app_worker_t ,
stream_session_t  
)

Definition at line 943 of file application.c.

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

◆ app_worker_get_or_alloc_connect_segment_manager()

segment_manager_t* app_worker_get_or_alloc_connect_segment_manager ( app_worker_t )

Definition at line 935 of file application.c.

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

◆ app_worker_local_sessions_free()

void app_worker_local_sessions_free ( app_worker_t app)

Definition at line 1926 of file application.c.

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

◆ app_worker_lock_and_send_event()

int app_worker_lock_and_send_event ( app_worker_t app,
stream_session_t s,
u8  evt_type 
)

Send event to application.

Logic from queue perspective is blocking. However, if queue is full, we return.

Definition at line 1418 of file application.c.

+ Here is the caller graph for this function:

◆ app_worker_n_listeners()

u32 app_worker_n_listeners ( app_worker_t app)

◆ app_worker_open_session()

int app_worker_open_session ( app_worker_t app,
session_endpoint_t tep,
u32  api_context 
)

Definition at line 898 of file application.c.

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

◆ app_worker_own_session()

int app_worker_own_session ( app_worker_t app_wrk,
stream_session_t s 
)

Definition at line 728 of file application.c.

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

◆ app_worker_send_event()

int app_worker_send_event ( app_worker_t app,
stream_session_t s,
u8  evt_type 
)

Send event to application.

Logic from queue perspective is non-blocking. If there's not enough space to enqueue a message, we return.

Definition at line 1405 of file application.c.

◆ application_alloc()

application_t* application_alloc ( void  )

Definition at line 203 of file application.c.

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

◆ application_alloc_and_init()

int application_alloc_and_init ( app_init_args_t args)

Definition at line 270 of file application.c.

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

◆ application_detach_process()

void application_detach_process ( application_t app,
u32  api_client_index 
)

Definition at line 412 of file application.c.

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

◆ application_free()

void application_free ( application_t app)

Definition at line 355 of file application.c.

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

◆ application_get()

application_t* application_get ( u32  index)

Definition at line 213 of file application.c.

+ Here is the caller graph for this function:

◆ application_get_default_worker()

app_worker_t* application_get_default_worker ( application_t app)

Definition at line 466 of file application.c.

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

◆ application_get_if_valid()

application_t* application_get_if_valid ( u32  index)

Definition at line 221 of file application.c.

+ Here is the caller graph for this function:

◆ application_get_local_listen_session()

static local_session_t* application_get_local_listen_session ( application_t app,
u32  session_index 
)
inlinestatic

Definition at line 359 of file application.h.

+ Here is the caller graph for this function:

◆ application_get_local_listen_session_from_handle()

local_session_t* application_get_local_listen_session_from_handle ( session_handle_t  lh)

◆ application_get_local_listener_w_handle()

static local_session_t* application_get_local_listener_w_handle ( session_handle_t  handle)
inlinestatic

Definition at line 365 of file application.h.

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

◆ application_get_local_session()

local_session_t* application_get_local_session ( app_worker_t app,
u32  session_index 
)

Definition at line 1445 of file application.c.

+ Here is the caller graph for this function:

◆ application_get_local_session_from_handle()

local_session_t* application_get_local_session_from_handle ( session_handle_t  handle)

Definition at line 1453 of file application.c.

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

◆ application_get_segment_manager_properties()

segment_manager_properties_t* application_get_segment_manager_properties ( u32  app_index)

Definition at line 1270 of file application.c.

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

◆ application_get_worker()

app_worker_t* application_get_worker ( application_t app,
u32  wrk_index 
)

Definition at line 456 of file application.c.

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

◆ application_has_global_scope()

u8 application_has_global_scope ( application_t app)

Definition at line 1048 of file application.c.

+ Here is the caller graph for this function:

◆ application_has_local_scope()

u8 application_has_local_scope ( application_t app)

Definition at line 1042 of file application.c.

+ Here is the caller graph for this function:

◆ application_is_builtin()

int application_is_builtin ( application_t app)

Definition at line 1030 of file application.c.

+ Here is the caller graph for this function:

◆ application_is_builtin_proxy()

int application_is_builtin_proxy ( application_t app)

Definition at line 1036 of file application.c.

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

◆ application_is_proxy()

int application_is_proxy ( application_t app)

Definition at line 1024 of file application.c.

+ Here is the caller graph for this function:

◆ application_listener_select_worker()

app_worker_t* application_listener_select_worker ( stream_session_t ls,
u8  is_local 
)

Definition at line 478 of file application.c.

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

◆ application_local_session_alloc()

local_session_t* application_local_session_alloc ( app_worker_t app)

Definition at line 1425 of file application.c.

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

◆ application_local_session_connect()

int application_local_session_connect ( app_worker_t client,
app_worker_t server,
local_session_t ls,
u32  opaque 
)

Definition at line 1641 of file application.c.

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

◆ application_local_session_connect_notify()

int application_local_session_connect_notify ( local_session_t ls)

Definition at line 1763 of file application.c.

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

◆ application_local_session_disconnect()

int application_local_session_disconnect ( u32  app_or_wrk,
local_session_t ls 
)

Definition at line 1854 of file application.c.

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

◆ application_local_session_disconnect_w_index()

int application_local_session_disconnect_w_index ( u32  app_or_wrk,
u32  ls_index 
)

Definition at line 1916 of file application.c.

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

◆ application_local_session_free()

void application_local_session_free ( app_worker_t app,
local_session_t ls 
)

Definition at line 1437 of file application.c.

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

◆ application_local_session_handle()

static session_handle_t application_local_session_handle ( local_session_t ls)
inlinestatic

Definition at line 352 of file application.h.

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

◆ application_local_session_listener_has_transport()

static u8 application_local_session_listener_has_transport ( local_session_t ls)
inlinestatic

Definition at line 375 of file application.h.

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

◆ application_local_session_table()

u32 application_local_session_table ( application_t app)

Definition at line 124 of file application.c.

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

◆ application_lookup()

application_t* application_lookup ( u32  api_client_index)

Definition at line 181 of file application.c.

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

◆ application_lookup_name()

application_t* application_lookup_name ( const u8 name)

Definition at line 192 of file application.c.

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

◆ application_name_from_index()

const u8* application_name_from_index ( u32  app_or_wrk)

Returns app name for app-index.

Definition at line 147 of file application.c.

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

◆ application_remove_proxy()

void application_remove_proxy ( application_t app)

Definition at line 1248 of file application.c.

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

◆ application_segment_manager_properties()

segment_manager_properties_t* application_segment_manager_properties ( application_t app)

Definition at line 1264 of file application.c.

+ Here is the caller graph for this function:

◆ application_session_table()

u32 application_session_table ( application_t app,
u8  fib_proto 
)

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_setup_proxy()

void application_setup_proxy ( application_t app)

Definition at line 1232 of file application.c.

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

◆ application_start_listen()

int application_start_listen ( application_t app,
session_endpoint_cfg_t sep_ext,
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 777 of file application.c.

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

◆ application_start_local_listen()

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

Definition at line 1489 of file application.c.

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

◆ application_stop_listen()

int application_stop_listen ( u32  app_index,
u32  app_wrk_index,
session_handle_t  handle 
)

Stop listening on session associated to handle.

Parameters
handlelistener handle
app_indexindex of the app owning the handle.
app_wrk_indexindex of the worker requesting the stop

Definition at line 859 of file application.c.

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

◆ application_stop_local_listen()

int application_stop_local_listen ( u32  app_index,
u32  wrk_map_index,
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 1551 of file application.c.

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

◆ application_use_mq_for_ctrl()

u8 application_use_mq_for_ctrl ( application_t app)

Definition at line 1054 of file application.c.

+ Here is the caller graph for this function:

◆ local_session_id()

static u32 local_session_id ( local_session_t ls)
inlinestatic

Definition at line 315 of file application.h.

+ Here is the caller graph for this function:

◆ local_session_parse_handle()

static void local_session_parse_handle ( session_handle_t  handle,
u32 app_or_wrk_index,
u32 session_index 
)
inlinestatic

Definition at line 342 of file application.h.

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

◆ local_session_parse_id()

static void local_session_parse_id ( u32  ls_id,
u32 app_or_wrk,
u32 session_index 
)
inlinestatic

Definition at line 335 of file application.h.

+ Here is the caller graph for this function:

◆ mq_send_local_session_disconnected_cb()

void mq_send_local_session_disconnected_cb ( u32  app_or_wrk,
local_session_t ls 
)

Definition at line 530 of file session_api.c.

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

◆ unformat_application_proto()

uword unformat_application_proto ( unformat_input_t input,
va_list *  args 
)
+ Here is the caller graph for this function:

◆ vnet_app_worker_add_del()

clib_error_t* vnet_app_worker_add_del ( vnet_app_worker_add_del_args_t a)

Definition at line 953 of file application.c.

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