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YvyeM67877RB\r\n" 78 "EDSKc/X8ESLfOB44iGvZUEMG6zJFscx9DgN25iQZAoGAbyd+JEWwdVH9/K3IH1t2\r\n" 79 "PBkZX17kNWv+iVM1WyFjbe++vfKZCrOJiyiqhDeEqgrP3AuNMlaaduC3VRC3G5oV\r\n" 80 "Mj1tlhDWQ/qhvKdCKNdIVQYDE75nw+FRWV8yYkHAnXYW3tNoweDIwixE0hkPR1bc\r\n" 81 "oEjPLVNtx8SOj/M4rhaPT3I=\r\n" "-----END PRIVATE KEY-----\r\n";
104 clib_warning (
"sw_if_index %u not configured with ip %U",
109 return (is_lep ||
ip_is_local (sep->fib_index, &sep->ip, sep->is_ip4));
118 *thread_index = handle & 0xFFFFFFFF;
119 *session_index = handle >> 32;
121 if (*thread_index >=
vec_len (smm->sessions))
122 return VNET_API_ERROR_INVALID_VALUE;
124 pool = smm->sessions[*thread_index];
127 return VNET_API_ERROR_INVALID_VALUE_2;
144 sep->sw_if_index = app_ns->sw_if_index;
146 sep->is_ip4 ? app_ns->ip4_fib_index : app_ns->ip6_fib_index;
162 return VNET_API_ERROR_APPLICATION_NOT_ATTACHED;
167 return VNET_API_ERROR_INVALID_VALUE_2;
173 return VNET_API_ERROR_ADDRESS_IN_USE;
223 return VNET_API_ERROR_APPLICATION_NOT_ATTACHED;
245 u32 table_index, server_index, li;
251 return VNET_API_ERROR_INVALID_VALUE;
266 return VNET_API_ERROR_APP_CONNECT_FILTERED;
278 if (server_index != client_index)
283 server, ll, api_context);
294 return VNET_API_ERROR_SESSION_CONNECT;
297 return VNET_API_ERROR_APP_CONNECT_SCOPE;
308 listener, api_context);
315 return VNET_API_ERROR_SESSION_CONNECT;
341 u32 transport_proto = 0, port;
346 sep->transport_proto = transport_proto;
347 sep->port = clib_host_to_net_u16 (port);
353 &sep->ip.ip4, &port))
355 sep->transport_proto = transport_proto;
356 sep->port = clib_host_to_net_u16 (port);
364 sep->transport_proto = transport_proto;
365 sep->port = clib_host_to_net_u16 (port);
371 &sep->ip.ip6, &port))
373 sep->transport_proto = transport_proto;
374 sep->port = clib_host_to_net_u16 (port);
396 uri = (
char *)
format (0,
"%s%c", uri, 0);
403 return VNET_API_ERROR_INVALID_VALUE;
421 if (
vec_len (namespace_id) == 0)
430 return VNET_API_ERROR_APP_INVALID_NS;
433 return VNET_API_ERROR_APP_INVALID_NS;
434 if (app_ns->ns_secret != secret)
435 return VNET_API_ERROR_APP_WRONG_NS_SECRET;
452 u32 app_ns_index = 0;
462 "api index or name must be provided");
466 "app already attached");
486 a->segment = &fs->
ssvm;
487 a->app_index = app->index;
506 return VNET_API_ERROR_APPLICATION_NOT_ATTACHED;
544 return VNET_API_ERROR_ADDRESS_NOT_IN_USE;
575 clib_warning (
"app %u is neither client nor server for session %u",
576 a->app_index, a->app_index);
577 return VNET_API_ERROR_INVALID_VALUE;
585 if (!s || s->app_index != a->app_index)
586 return VNET_API_ERROR_INVALID_VALUE;
600 if ((rv =
vnet_bind_i (a->app_index, &a->sep, &a->handle)))
int application_open_session(application_t *app, session_endpoint_t *sep, u32 api_context)
#define SESSION_DROP_HANDLE
u8 session_endpoint_in_ns(session_endpoint_t *sep)
#define APP_NAMESPACE_INVALID_INDEX
void segment_manager_segment_reader_unlock(segment_manager_t *sm)
static session_endpoint_extended_t * cache_sep
const u32 test_srv_crt_rsa_len
u64 session_lookup_endpoint_listener(u32 table_index, session_endpoint_t *sep, u8 use_rules)
Lookup listener for session endpoint in table.
static u8 session_endpoint_is_local(session_endpoint_t *sep)
u8 application_has_global_scope(application_t *app)
struct _vnet_connect_args vnet_connect_args_t
int vnet_bind_uri(vnet_bind_args_t *a)
const u32 test_srv_key_rsa_len
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.
int application_stop_listen(application_t *srv, session_handle_t handle)
Stop listening on session associated to handle.
clib_error_t * vnet_unbind(vnet_unbind_args_t *a)
int application_start_local_listen(application_t *server, session_endpoint_t *sep, session_handle_t *handle)
application_t * application_lookup_name(const u8 *name)
u8 ip_interface_has_address(u32 sw_if_index, ip46_address_t *ip, u8 is_ip4)
application_t * application_new()
u32 session_lookup_get_index_for_fib(u32 fib_proto, u32 fib_index)
u32 client_index
Client data.
local_session_t * application_get_local_session_from_handle(session_handle_t handle)
application_t * application_lookup(u32 api_client_index)
static int vnet_bind_i(u32 app_index, session_endpoint_t *sep, u64 *handle)
static u32 session_index_from_handle(session_handle_t handle)
#define SESSION_ENDPOINT_EXT_NULL
stream_session_t * session_lookup_listener(u32 table_index, session_endpoint_t *sep)
Lookup listener, exact or proxy (inaddr_any:0) match.
static stream_session_t * listen_session_get_from_handle(session_handle_t handle)
int application_is_proxy(application_t *app)
int vnet_unbind_uri(vnet_unbind_args_t *a)
struct _vnet_disconnect_args_t vnet_disconnect_args_t
u32 transport_listener_index
struct _vnet_unbind_args_t vnet_unbind_args_t
svm_fifo_segment_private_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.
static local_session_t * application_get_local_listen_session(application_t *app, u32 session_index)
u32 app_namespace_index_from_id(const u8 *ns_id)
struct _stream_session_t stream_session_t
struct _vnet_app_attach_args_t vnet_app_attach_args_t
static session_manager_main_t * vnet_get_session_manager_main()
struct _session_endpoint session_endpoint_t
static void local_session_parse_handle(session_handle_t handle, u32 *server_index, u32 *session_index)
static u8 session_handle_is_local(session_handle_t handle)
#define APP_INVALID_INDEX
app_namespace_t * app_namespace_get(u32 index)
clib_error_t * vnet_connect(vnet_connect_args_t *a)
u32 application_session_table(application_t *app, u8 fib_proto)
struct _session_manager_main session_manager_main_t
int parse_uri(char *uri, session_endpoint_extended_t *sep)
const char test_srv_crt_rsa[]
#define SESSION_DBG(_fmt, _args...)
u64 session_lookup_local_endpoint(u32 table_index, session_endpoint_t *sep)
Look up endpoint in local session table.
u32 application_local_session_table(application_t *app)
#define vec_free(V)
Free vector's memory (no header).
#define ENDPOINT_INVALID_INDEX
int session_lookup_del_session_endpoint(u32 table_index, session_endpoint_t *sep)
#define clib_warning(format, args...)
#define SESSION_INVALID_HANDLE
int vnet_unbind_i(u32 app_index, session_handle_t handle)
int application_start_listen(application_t *srv, session_endpoint_t *sep, session_handle_t *res)
Start listening local transport endpoint for requested transport.
#define pool_is_free_index(P, I)
Use free bitmap to query whether given index is free.
struct _application application_t
int vnet_disconnect_session(vnet_disconnect_args_t *a)
int api_parse_session_handle(u64 handle, u32 *session_index, u32 *thread_index)
struct _app_namespace app_namespace_t
static stream_session_t * session_get_from_handle_if_valid(session_handle_t handle)
clib_error_t * vnet_bind(vnet_bind_args_t *a)
uword unformat_transport_proto(unformat_input_t *input, va_list *args)
static local_session_t * application_get_local_listener_w_handle(session_handle_t handle)
static void session_endpoint_update_for_app(session_endpoint_t *sep, application_t *app)
static u8 session_endpoint_fib_proto(session_endpoint_t *sep)
int application_stop_local_listen(application_t *server, session_handle_t lh)
Clean up local session table.
static void clib_mem_free(void *p)
static u8 session_endpoint_is_zero(session_endpoint_t *sep)
void application_del(application_t *app)
void stream_session_disconnect(stream_session_t *s)
Initialize session disconnect.
int application_local_session_disconnect(u32 app_index, local_session_t *ls)
struct _vnet_app_detach_args_t vnet_app_detach_args_t
static void * clib_mem_alloc(uword size)
static uword pointer_to_uword(const void *p)
u8 ip_is_zero(ip46_address_t *ip46_address, u8 is_ip4)
uword unformat_vnet_uri(unformat_input_t *input, va_list *args)
unformat a vnet URI
clib_error_t * vnet_connect_uri(vnet_connect_args_t *a)
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
clib_error_t * vnet_application_attach(vnet_app_attach_args_t *a)
Attach application to vpp.
static fib_protocol_t fib_ip_proto(bool is_ip6)
Convert from boolean is_ip6 to FIB protocol.
application_t * application_get(u32 index)
u8 ip_is_local_host(ip46_address_t *ip46_address, u8 is_ip4)
struct _segment_manager segment_manager_t
int application_init(application_t *app, u32 api_client_index, u8 *app_name, u64 *options, session_cb_vft_t *cb_fns)
#define clib_error_return_code(e, code, flags, args...)
void application_setup_proxy(application_t *app)
static int session_validate_namespace(u8 *namespace_id, u64 secret, u32 *app_ns_index)
int vnet_application_detach(vnet_app_detach_args_t *a)
Detach application from vpp.
struct _vnet_bind_args_t vnet_bind_args_t
static segment_manager_t * segment_manager_get(u32 index)
static u64 listen_session_get_handle(stream_session_t *s)
struct _session_endpoint_extended session_endpoint_extended_t
application_t * application_get_if_valid(u32 index)
const char test_srv_key_rsa[]
int application_connect(u32 client_index, u32 api_context, session_endpoint_t *sep)
int application_local_session_connect(u32 table_index, application_t *client, application_t *server, local_session_t *ll, u32 opaque)
u8 application_has_local_scope(application_t *app)
u32 app_index
Server index.