FD.io VPP  v19.01.3-6-g70449b9b9
Vector Packet Processing
application_interface.c File Reference

VPP's application/session API bind/unbind/connect/disconnect calls. More...

+ Include dependency graph for application_interface.c:

Go to the source code of this file.

Macros

#define app_interface_check_thread_and_barrier(_fn, _arg)
 

Functions

static u8 session_endpoint_is_local (session_endpoint_t *sep)
 
static u8 session_endpoint_is_zero (session_endpoint_t *sep)
 
u8 session_endpoint_in_ns (session_endpoint_t *sep)
 
int api_parse_session_handle (u64 handle, u32 *session_index, u32 *thread_index)
 
static void session_endpoint_update_for_app (session_endpoint_cfg_t *sep, application_t *app, u8 is_connect)
 
static int vnet_bind_inline (vnet_bind_args_t *a)
 
static int vnet_unbind_inline (vnet_unbind_args_t *a)
 
static int application_connect (vnet_connect_args_t *a)
 
uword unformat_vnet_uri (unformat_input_t *input, va_list *args)
 unformat a vnet URI More...
 
int parse_uri (char *uri, session_endpoint_cfg_t *sep)
 
static int app_validate_namespace (u8 *namespace_id, u64 secret, u32 *app_ns_index)
 
static u8app_name_from_api_index (u32 api_client_index)
 
clib_error_tvnet_application_attach (vnet_app_attach_args_t *a)
 Attach application to vpp. More...
 
int vnet_application_detach (vnet_app_detach_args_t *a)
 Detach application from vpp. More...
 
int vnet_bind_uri (vnet_bind_args_t *a)
 
int vnet_unbind_uri (vnet_unbind_args_t *a)
 
clib_error_tvnet_connect_uri (vnet_connect_args_t *a)
 
int vnet_disconnect_session (vnet_disconnect_args_t *a)
 
clib_error_tvnet_bind (vnet_bind_args_t *a)
 
clib_error_tvnet_unbind (vnet_unbind_args_t *a)
 
clib_error_tvnet_connect (vnet_connect_args_t *a)
 

Variables

const char test_srv_crt_rsa []
 
const u32 test_srv_crt_rsa_len = sizeof (test_srv_crt_rsa)
 
const char test_srv_key_rsa []
 
const u32 test_srv_key_rsa_len = sizeof (test_srv_key_rsa)
 
static u8cache_uri
 
static session_endpoint_cfg_tcache_sep
 

Detailed Description

VPP's application/session API bind/unbind/connect/disconnect calls.

Definition in file application_interface.c.

Macro Definition Documentation

◆ app_interface_check_thread_and_barrier

#define app_interface_check_thread_and_barrier (   _fn,
  _arg 
)
Value:
{ \
vlib_rpc_call_main_thread (_fn, (u8 *) _arg, sizeof(*_arg)); \
return 0; \
}
unsigned char u8
Definition: types.h:56
#define PREDICT_FALSE(x)
Definition: clib.h:111
static u8 vlib_thread_is_main_w_barrier(void)
Definition: threads.h:511

Definition at line 84 of file application_interface.c.

Function Documentation

◆ api_parse_session_handle()

int api_parse_session_handle ( u64  handle,
u32 session_index,
u32 thread_index 
)

Definition at line 120 of file application_interface.c.

+ Here is the call graph for this function:

◆ app_name_from_api_index()

static u8* app_name_from_api_index ( u32  api_client_index)
static

Definition at line 490 of file application_interface.c.

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

◆ app_validate_namespace()

static int app_validate_namespace ( u8 namespace_id,
u64  secret,
u32 app_ns_index 
)
static

Definition at line 468 of file application_interface.c.

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

◆ application_connect()

static int application_connect ( vnet_connect_args_t a)
static

Definition at line 286 of file application_interface.c.

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

◆ parse_uri()

int parse_uri ( char *  uri,
session_endpoint_cfg_t sep 
)

Definition at line 435 of file application_interface.c.

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

◆ session_endpoint_in_ns()

u8 session_endpoint_in_ns ( session_endpoint_t sep)

Definition at line 105 of file application_interface.c.

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

◆ session_endpoint_is_local()

static u8 session_endpoint_is_local ( session_endpoint_t sep)
static

Definition at line 92 of file application_interface.c.

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

◆ session_endpoint_is_zero()

static u8 session_endpoint_is_zero ( session_endpoint_t sep)
static

Definition at line 99 of file application_interface.c.

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

◆ session_endpoint_update_for_app()

static void session_endpoint_update_for_app ( session_endpoint_cfg_t sep,
application_t app,
u8  is_connect 
)
static

Definition at line 140 of file application_interface.c.

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

◆ unformat_vnet_uri()

uword unformat_vnet_uri ( unformat_input_t input,
va_list *  args 
)

unformat a vnet URI

transport-proto://[hostname]ip46-addr:port eg. tcp://ip46-addr:port tls://[testtsl.fd.io]ip46-addr:port

u8 ip46_address[16]; u16 port_in_host_byte_order; stream_session_type_t sst; u8 *fifo_name;

if (unformat (input, "%U", unformat_vnet_uri(), &ip46_address, &sst, &port, &fifo_name)) etc...

Definition at line 388 of file application_interface.c.

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

◆ vnet_application_attach()

clib_error_t* vnet_application_attach ( vnet_app_attach_args_t a)

Attach application to vpp.

Allocates a vpp app, i.e., a structure that keeps back pointers to external app and a segment manager for shared memory fifo based communication with the external app.

Definition at line 510 of file application_interface.c.

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

◆ vnet_application_detach()

int vnet_application_detach ( vnet_app_detach_args_t a)

Detach application from vpp.

Definition at line 572 of file application_interface.c.

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

◆ vnet_bind()

clib_error_t* vnet_bind ( vnet_bind_args_t a)

Definition at line 678 of file application_interface.c.

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

◆ vnet_bind_inline()

static int vnet_bind_inline ( vnet_bind_args_t a)
inlinestatic

Definition at line 191 of file application_interface.c.

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

◆ vnet_bind_uri()

int vnet_bind_uri ( vnet_bind_args_t a)

Definition at line 589 of file application_interface.c.

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

◆ vnet_connect()

clib_error_t* vnet_connect ( vnet_connect_args_t a)

Definition at line 696 of file application_interface.c.

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

◆ vnet_connect_uri()

clib_error_t* vnet_connect_uri ( vnet_connect_args_t a)

Definition at line 626 of file application_interface.c.

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

◆ vnet_disconnect_session()

int vnet_disconnect_session ( vnet_disconnect_args_t a)

Definition at line 643 of file application_interface.c.

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

◆ vnet_unbind()

clib_error_t* vnet_unbind ( vnet_unbind_args_t a)

Definition at line 687 of file application_interface.c.

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

◆ vnet_unbind_inline()

static int vnet_unbind_inline ( vnet_unbind_args_t a)
inlinestatic

Definition at line 258 of file application_interface.c.

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

◆ vnet_unbind_uri()

int vnet_unbind_uri ( vnet_unbind_args_t a)

Definition at line 603 of file application_interface.c.

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

Variable Documentation

◆ cache_sep

session_endpoint_cfg_t* cache_sep
static

Definition at line 432 of file application_interface.c.

◆ cache_uri

u8* cache_uri
static

Definition at line 431 of file application_interface.c.

◆ test_srv_crt_rsa

const char test_srv_crt_rsa[]
Initial value:
=
"-----BEGIN CERTIFICATE-----\r\n"
"MIID5zCCAs+gAwIBAgIJALeMYCEHrTtJMA0GCSqGSIb3DQEBCwUAMIGJMQswCQYD\r\n"
"VQQGEwJVUzELMAkGA1UECAwCQ0ExETAPBgNVBAcMCFNhbiBKb3NlMQ4wDAYDVQQK\r\n"
"DAVDaXNjbzEOMAwGA1UECwwFZmQuaW8xFjAUBgNVBAMMDXRlc3R0bHMuZmQuaW8x\r\n"
"IjAgBgkqhkiG9w0BCQEWE3ZwcC1kZXZAbGlzdHMuZmQuaW8wHhcNMTgwMzA1MjEx\r\n"
"NTEyWhcNMjgwMzAyMjExNTEyWjCBiTELMAkGA1UEBhMCVVMxCzAJBgNVBAgMAkNB\r\n"
"MREwDwYDVQQHDAhTYW4gSm9zZTEOMAwGA1UECgwFQ2lzY28xDjAMBgNVBAsMBWZk\r\n"
"LmlvMRYwFAYDVQQDDA10ZXN0dGxzLmZkLmlvMSIwIAYJKoZIhvcNAQkBFhN2cHAt\r\n"
"ZGV2QGxpc3RzLmZkLmlvMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA\r\n"
"4C1k8a1DuStgggqT4o09fP9sJ2dC54bxhS/Xk2VEfaIZ222WSo4X/syRVfVy9Yah\r\n"
"cpI1zJ/RDxaZSFhgA+nPZBrFMsrULkrdAOpOVj8eDEp9JuWdO2ODSoFnCvLxcYWB\r\n"
"Yc5kHryJpEaGJl1sFQSesnzMFty/59ta0stk0Fp8r5NhIjWvSovGzPo6Bhz+VS2c\r\n"
"ebIZh4x1t2hHaFcgm0qJoJ6DceReWCW8w+yOVovTolGGq+bpb2Hn7MnRSZ2K2NdL\r\n"
"+aLXpkZbS/AODP1FF2vTO1mYL290LO7/51vJmPXNKSDYMy5EvILr5/VqtjsFCwRL\r\n"
"Q4jcM/+GeHSAFWx4qIv0BwIDAQABo1AwTjAdBgNVHQ4EFgQUWa1SOB37xmT53tZQ\r\n"
"aXuLLhRI7U8wHwYDVR0jBBgwFoAUWa1SOB37xmT53tZQaXuLLhRI7U8wDAYDVR0T\r\n"
"BAUwAwEB/zANBgkqhkiG9w0BAQsFAAOCAQEAoUht13W4ya27NVzQuCMvqPWL3VM4\r\n"
"3xbPFk02FaGz/WupPu276zGlzJAZrbuDcQowwwU1Ni1Yygxl96s1c2M5rHDTrOKG\r\n"
"rK0hbkSFBo+i6I8u4HiiQ4rYmG0Hv6+sXn3of0HsbtDPGgWZoipPWDljPYEURu3e\r\n"
"3HRe/Dtsj9CakBoSDzs8ndWaBR+f4sM9Tk1cjD46Gq2T/qpSPXqKxEUXlzhdCAn4\r\n"
"twub17Bq2kykHpppCwPg5M+v30tHG/R2Go15MeFWbEJthFk3TZMjKL7UFs7fH+x2\r\n"
"wSonXb++jY+KmCb93C+soABBizE57g/KmiR2IxQ/LMjDik01RSUIaM0lLA==\r\n"
"-----END CERTIFICATE-----\r\n"

Definition at line 28 of file application_interface.c.

◆ test_srv_crt_rsa_len

const u32 test_srv_crt_rsa_len = sizeof (test_srv_crt_rsa)

Definition at line 52 of file application_interface.c.

◆ test_srv_key_rs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ECgYEA68mRpteunF1mdZgXs+WrN+uLlRrQR20F\r\n"
"ZyMYiUCH2Dtn26EzA2moy7FipIIrQcX/j+KhYNGM3e7MU4LymIO29E18mn8JODnH\r\n"
"sQOXzBTsf8A4yIVMkcuQD3bfb0JiUGYUPOidTp2N7IJA7+6Yc3vQOyb74lnKnJoO\r\n"
"gougPT2wS+cCgYAn7muzb6xFsXDhyW0Tm6YJYBfRS9yAWEuVufINobeBZPSl2cN1\r\n"
"Jrnw+HlrfTNbrJWuJmjtZJXUXQ6cVp2rUbjutNyRV4vG6iRwEXYQ40EJdkr1gZpi\r\n"
"CHQhuShuuPih2MNAy7EEbM+sXrDjTBR3bFqzuHPzu7dp+BshCFX3lRfAAQKBgGQt\r\n"
"K5i7IhCFDjb/+3IPLgOAK7mZvsvZ4eXD33TQ2eZgtut1PXtBtNl17/b85uv293Fm\r\n"
"VDISVcsk3eLNS8zIiT6afUoWlxAwXEs0v5WRfjl4radkGvgGiJpJYvyeM67877RB\r\n"
"EDSKc/X8ESLfOB44iGvZUEMG6zJFscx9DgN25iQZAoGAbyd+JEWwdVH9/K3IH1t2\r\n"
"PBkZX17kNWv+iVM1WyFjbe++vfKZCrOJiyiqhDeEqgrP3AuNMlaaduC3VRC3G5oV\r\n"
"Mj1tlhDWQ/qhvKdCKNdIVQYDE75nw+FRWV8yYkHAnXYW3tNoweDIwixE0hkPR1bc\r\n"
"oEjPLVNtx8SOj/M4rhaPT3I=\r\n" "-----END PRIVATE KEY-----\r\n"

Definition at line 54 of file application_interface.c.

◆ test_srv_key_rsa_len

const u32 test_srv_key_rsa_len = sizeof (test_srv_key_rsa)

Definition at line 82 of file application_interface.c.