X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvnet%2Fsession%2Fapplication_interface.h;h=5e1fe8ee528e3c55f267f7b1d6966413975936ad;hb=cea194d8f973a2f2b5ef72d212533057174cc70a;hp=7d924c146a41f402d9724ff34994762ddf97ec26;hpb=a5464817522c7a7dc760af4612f1d6a68ed0afc8;p=vpp.git diff --git a/src/vnet/session/application_interface.h b/src/vnet/session/application_interface.h index 7d924c146a4..5e1fe8ee528 100644 --- a/src/vnet/session/application_interface.h +++ b/src/vnet/session/application_interface.h @@ -22,12 +22,6 @@ #include #include -typedef enum _session_api_proto -{ - SESSION_PROTO_TCP, - SESSION_PROTO_UDP -} session_api_proto_t; - typedef struct _vnet_app_attach_args_t { /** Binary API client index */ @@ -36,12 +30,12 @@ typedef struct _vnet_app_attach_args_t /** Application and segment manager options */ u64 *options; + /* Namespace id */ + u8 *namespace_id; + /** Session to application callback functions */ session_cb_vft_t *session_cb_vft; - /** Flag that indicates if app is builtin */ - u8 builtin; - /* * Results */ @@ -64,8 +58,8 @@ typedef struct _vnet_bind_args_t char *uri; struct { - transport_endpoint_t tep; - session_api_proto_t proto; + session_endpoint_t sep; + transport_proto_t proto; }; }; @@ -97,8 +91,8 @@ typedef struct _vnet_connect_args char *uri; struct { - transport_endpoint_t tep; - session_api_proto_t proto; + session_endpoint_t sep; + transport_proto_t proto; }; }; u32 app_index; @@ -106,6 +100,9 @@ typedef struct _vnet_connect_args /* Used for redirects */ void *mp; + + /* used for proxy connections */ + u64 server_handle; } vnet_connect_args_t; typedef struct _vnet_disconnect_args_t @@ -119,18 +116,27 @@ typedef enum { APP_EVT_QUEUE_SIZE, APP_OPTIONS_FLAGS, + APP_OPTIONS_PREALLOC_FIFO_PAIRS, + APP_OPTIONS_PRIVATE_SEGMENT_COUNT, + APP_OPTIONS_PRIVATE_SEGMENT_SIZE, + APP_OPTIONS_NAMESPACE, + APP_OPTIONS_NAMESPACE_SECRET, SESSION_OPTIONS_SEGMENT_SIZE, SESSION_OPTIONS_ADD_SEGMENT_SIZE, SESSION_OPTIONS_RX_FIFO_SIZE, SESSION_OPTIONS_TX_FIFO_SIZE, + SESSION_OPTIONS_PREALLOCATED_FIFO_PAIRS, SESSION_OPTIONS_ACCEPT_COOKIE, SESSION_OPTIONS_N_OPTIONS } app_attach_options_index_t; #define foreach_app_options_flags \ - _(USE_FIFO, "Use FIFO with redirects") \ + _(ACCEPT_REDIRECT, "Use FIFO with redirects") \ _(ADD_SEGMENT, "Add segment and signal app if needed") \ _(BUILTIN_APP, "Application is builtin") \ + _(IS_PROXY, "Application is proxying") \ + _(USE_GLOBAL_SCOPE, "App can use global session scope") \ + _(USE_LOCAL_SCOPE, "App can use local session scope") typedef enum _app_options { @@ -146,25 +152,17 @@ typedef enum _app_options_flags #undef _ } app_options_flags_t; -///** Server can handle delegated connect requests from local clients */ -//#define APP_OPTIONS_FLAGS_USE_FIFO (1<<0) -// -///** Server wants vpp to add segments when out of memory for fifos */ -//#define APP_OPTIONS_FLAGS_ADD_SEGMENT (1<<1) - -#define VNET_CONNECT_REDIRECTED 123 - -int vnet_application_attach (vnet_app_attach_args_t * a); +clib_error_t *vnet_application_attach (vnet_app_attach_args_t * a); int vnet_application_detach (vnet_app_detach_args_t * a); int vnet_bind_uri (vnet_bind_args_t *); int vnet_unbind_uri (vnet_unbind_args_t * a); -int vnet_connect_uri (vnet_connect_args_t * a); +clib_error_t *vnet_connect_uri (vnet_connect_args_t * a); int vnet_disconnect_session (vnet_disconnect_args_t * a); -int vnet_bind (vnet_bind_args_t * a); -int vnet_connect (vnet_connect_args_t * a); -int vnet_unbind (vnet_unbind_args_t * a); +clib_error_t *vnet_bind (vnet_bind_args_t * a); +clib_error_t *vnet_connect (vnet_connect_args_t * a); +clib_error_t *vnet_unbind (vnet_unbind_args_t * a); int api_parse_session_handle (u64 handle, u32 * session_index,