Dave Barach | 68b0fb0 | 2017-02-28 15:15:56 -0500 | [diff] [blame] | 1 | /* |
Florin Coras | 288eaab | 2019-02-03 15:26:14 -0800 | [diff] [blame] | 2 | * Copyright (c) 2017-2019 Cisco and/or its affiliates. |
Dave Barach | 68b0fb0 | 2017-02-28 15:15:56 -0500 | [diff] [blame] | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | * you may not use this file except in compliance with the License. |
| 5 | * You may obtain a copy of the License at: |
| 6 | * |
| 7 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | * |
| 9 | * Unless required by applicable law or agreed to in writing, software |
| 10 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | * See the License for the specific language governing permissions and |
| 13 | * limitations under the License. |
| 14 | */ |
| 15 | |
| 16 | #ifndef SRC_VNET_SESSION_APPLICATION_H_ |
| 17 | #define SRC_VNET_SESSION_APPLICATION_H_ |
| 18 | |
Florin Coras | c1a4265 | 2019-02-08 18:27:29 -0800 | [diff] [blame] | 19 | #include <vnet/session/application_interface.h> |
| 20 | #include <vnet/session/application_namespace.h> |
Florin Coras | 1ee7830 | 2019-02-05 15:51:15 -0800 | [diff] [blame] | 21 | #include <vnet/session/session_types.h> |
Florin Coras | 6cf30ad | 2017-04-04 23:08:23 -0700 | [diff] [blame] | 22 | #include <vnet/session/segment_manager.h> |
Dave Barach | 68b0fb0 | 2017-02-28 15:15:56 -0500 | [diff] [blame] | 23 | |
Florin Coras | 1553197 | 2018-08-12 23:50:53 -0700 | [diff] [blame] | 24 | #define APP_DEBUG 0 |
| 25 | |
| 26 | #if APP_DEBUG > 0 |
| 27 | #define APP_DBG(_fmt, _args...) clib_warning (_fmt, ##_args) |
| 28 | #else |
| 29 | #define APP_DBG(_fmt, _args...) |
| 30 | #endif |
| 31 | |
Florin Coras | 1553197 | 2018-08-12 23:50:53 -0700 | [diff] [blame] | 32 | typedef struct app_worker_ |
Dave Barach | 68b0fb0 | 2017-02-28 15:15:56 -0500 | [diff] [blame] | 33 | { |
Florin Coras | ab2f6db | 2018-08-31 14:31:41 -0700 | [diff] [blame] | 34 | CLIB_CACHE_LINE_ALIGN_MARK (cacheline0); |
| 35 | |
Florin Coras | 1553197 | 2018-08-12 23:50:53 -0700 | [diff] [blame] | 36 | /** Worker index in global worker pool*/ |
| 37 | u32 wrk_index; |
Dave Barach | 68b0fb0 | 2017-02-28 15:15:56 -0500 | [diff] [blame] | 38 | |
Florin Coras | 1553197 | 2018-08-12 23:50:53 -0700 | [diff] [blame] | 39 | /** Worker index in app's map pool */ |
| 40 | u32 wrk_map_index; |
Dave Barach | 68b0fb0 | 2017-02-28 15:15:56 -0500 | [diff] [blame] | 41 | |
Florin Coras | 1553197 | 2018-08-12 23:50:53 -0700 | [diff] [blame] | 42 | /** Index of owning app */ |
| 43 | u32 app_index; |
Florin Coras | cea194d | 2017-10-02 00:18:51 -0700 | [diff] [blame] | 44 | |
Dave Barach | 68b0fb0 | 2017-02-28 15:15:56 -0500 | [diff] [blame] | 45 | /** Application listens for events on this svm queue */ |
Florin Coras | 3c2fed5 | 2018-07-04 04:15:05 -0700 | [diff] [blame] | 46 | svm_msg_q_t *event_queue; |
Dave Barach | 68b0fb0 | 2017-02-28 15:15:56 -0500 | [diff] [blame] | 47 | |
Florin Coras | f8f516a | 2018-02-08 15:10:09 -0800 | [diff] [blame] | 48 | /** Segment manager used for outgoing connects issued by the app */ |
Florin Coras | 6cf30ad | 2017-04-04 23:08:23 -0700 | [diff] [blame] | 49 | u32 connects_seg_manager; |
| 50 | |
Florin Coras | c87c91d | 2017-08-16 19:55:49 -0700 | [diff] [blame] | 51 | /** Lookup tables for listeners. Value is segment manager index */ |
Florin Coras | 6cf30ad | 2017-04-04 23:08:23 -0700 | [diff] [blame] | 52 | uword *listeners_table; |
| 53 | |
Florin Coras | 7999e83 | 2017-10-31 01:51:04 -0700 | [diff] [blame] | 54 | /** |
| 55 | * First segment manager has in the the first segment the application's |
Florin Coras | c87c91d | 2017-08-16 19:55:49 -0700 | [diff] [blame] | 56 | * event fifo. Depending on what the app does, it may be either used for |
Florin Coras | 7999e83 | 2017-10-31 01:51:04 -0700 | [diff] [blame] | 57 | * a listener or for connects. |
| 58 | */ |
Florin Coras | 6cf30ad | 2017-04-04 23:08:23 -0700 | [diff] [blame] | 59 | u32 first_segment_manager; |
Florin Coras | 0e9c33b | 2017-08-14 22:33:41 -0700 | [diff] [blame] | 60 | u8 first_segment_manager_in_use; |
Florin Coras | 6cf30ad | 2017-04-04 23:08:23 -0700 | [diff] [blame] | 61 | |
Florin Coras | 053a0e4 | 2018-11-13 15:52:38 -0800 | [diff] [blame] | 62 | /** API index for the worker. Needed for multi-process apps */ |
Florin Coras | c1f5a43 | 2018-11-20 11:31:26 -0800 | [diff] [blame] | 63 | u32 api_client_index; |
Florin Coras | 053a0e4 | 2018-11-13 15:52:38 -0800 | [diff] [blame] | 64 | |
Florin Coras | 1553197 | 2018-08-12 23:50:53 -0700 | [diff] [blame] | 65 | u8 app_is_builtin; |
Florin Coras | d50ff7f | 2020-04-16 04:30:22 +0000 | [diff] [blame] | 66 | |
| 67 | /** Per transport proto hash tables of half-open connection handles */ |
| 68 | uword **half_open_table; |
Florin Coras | c8e812f | 2020-05-14 05:32:18 +0000 | [diff] [blame] | 69 | |
| 70 | /** Protects detached seg managers */ |
| 71 | clib_spinlock_t detached_seg_managers_lock; |
| 72 | |
| 73 | /** Vector of detached listener segment managers */ |
| 74 | u32 *detached_seg_managers; |
Florin Coras | 1553197 | 2018-08-12 23:50:53 -0700 | [diff] [blame] | 75 | } app_worker_t; |
| 76 | |
| 77 | typedef struct app_worker_map_ |
| 78 | { |
| 79 | u32 wrk_index; |
| 80 | } app_worker_map_t; |
| 81 | |
Florin Coras | ab2f6db | 2018-08-31 14:31:41 -0700 | [diff] [blame] | 82 | typedef struct app_listener_ |
| 83 | { |
| 84 | clib_bitmap_t *workers; /**< workers accepting connections */ |
| 85 | u32 accept_rotor; /**< last worker to accept a connection */ |
Florin Coras | 87d6633 | 2019-06-11 12:31:31 -0700 | [diff] [blame] | 86 | u32 al_index; /**< app listener index in app pool */ |
| 87 | u32 app_index; /**< owning app index */ |
| 88 | u32 local_index; /**< local listening session index */ |
| 89 | u32 session_index; /**< global listening session index */ |
| 90 | session_handle_t ls_handle; /**< session handle of the local or global |
| 91 | listening session that also identifies |
| 92 | the app listener */ |
Florin Coras | ab2f6db | 2018-08-31 14:31:41 -0700 | [diff] [blame] | 93 | } app_listener_t; |
| 94 | |
Florin Coras | 41d5f54 | 2021-01-15 13:49:33 -0800 | [diff] [blame] | 95 | typedef enum app_rx_mq_flags_ |
| 96 | { |
| 97 | APP_RX_MQ_F_PENDING = 1 << 0, |
| 98 | APP_RX_MQ_F_POSTPONED = 1 << 1, |
| 99 | } app_rx_mq_flags_t; |
| 100 | |
| 101 | typedef struct app_rx_mq_elt_ |
| 102 | { |
| 103 | struct app_rx_mq_elt_ *next; |
| 104 | struct app_rx_mq_elt_ *prev; |
| 105 | svm_msg_q_t *mq; |
| 106 | uword file_index; |
| 107 | u32 app_index; |
| 108 | u8 flags; |
| 109 | } app_rx_mq_elt_t; |
| 110 | |
Florin Coras | 1553197 | 2018-08-12 23:50:53 -0700 | [diff] [blame] | 111 | typedef struct application_ |
| 112 | { |
| 113 | /** App index in app pool */ |
| 114 | u32 app_index; |
| 115 | |
Florin Coras | 1553197 | 2018-08-12 23:50:53 -0700 | [diff] [blame] | 116 | /** Flags */ |
| 117 | u32 flags; |
| 118 | |
| 119 | /** Callbacks: shoulder-taps for the server/client */ |
| 120 | session_cb_vft_t cb_fns; |
| 121 | |
| 122 | /** Segment manager properties. Shared by all segment managers */ |
Florin Coras | 88001c6 | 2019-04-24 14:44:46 -0700 | [diff] [blame] | 123 | segment_manager_props_t sm_properties; |
Florin Coras | 1553197 | 2018-08-12 23:50:53 -0700 | [diff] [blame] | 124 | |
| 125 | /** Pool of mappings that keep track of workers associated to this app */ |
| 126 | app_worker_map_t *worker_maps; |
| 127 | |
| 128 | /** Name registered by builtin apps */ |
| 129 | u8 *name; |
| 130 | |
| 131 | /** Namespace the application belongs to */ |
| 132 | u32 ns_index; |
| 133 | |
| 134 | u16 proxied_transports; |
| 135 | |
Florin Coras | ab2f6db | 2018-08-31 14:31:41 -0700 | [diff] [blame] | 136 | /** Pool of listeners for the app */ |
| 137 | app_listener_t *listeners; |
| 138 | |
Florin Coras | 58d36f0 | 2018-03-09 13:05:53 -0800 | [diff] [blame] | 139 | /** Preferred tls engine */ |
| 140 | u8 tls_engine; |
Florin Coras | ab2f6db | 2018-08-31 14:31:41 -0700 | [diff] [blame] | 141 | |
Nathan Skrzypczak | c298f37 | 2019-11-12 16:41:00 +0100 | [diff] [blame] | 142 | /** quic initialization vector */ |
| 143 | char quic_iv[17]; |
| 144 | u8 quic_iv_set; |
Nathan Skrzypczak | 60f3e65 | 2019-03-19 13:57:31 +0100 | [diff] [blame] | 145 | |
Florin Coras | 41d5f54 | 2021-01-15 13:49:33 -0800 | [diff] [blame] | 146 | /** Segment where rx mqs were allocated */ |
| 147 | fifo_segment_t rx_mqs_segment; |
| 148 | |
| 149 | /** |
| 150 | * Fixed vector of rx mqs that can be a part of pending_rx_mqs |
| 151 | * linked list maintained by the app sublayer for each worker |
| 152 | */ |
| 153 | app_rx_mq_elt_t *rx_mqs; |
Dave Barach | 68b0fb0 | 2017-02-28 15:15:56 -0500 | [diff] [blame] | 154 | } application_t; |
| 155 | |
Florin Coras | 41d5f54 | 2021-01-15 13:49:33 -0800 | [diff] [blame] | 156 | typedef struct app_rx_mq_handle_ |
| 157 | { |
| 158 | union |
| 159 | { |
| 160 | struct |
| 161 | { |
| 162 | u32 app_index; |
| 163 | u32 thread_index; |
| 164 | }; |
| 165 | u64 as_u64; |
| 166 | }; |
| 167 | } __attribute__ ((aligned (sizeof (u64)))) app_rx_mq_handle_t; |
| 168 | |
| 169 | /** |
| 170 | * App sublayer per vpp worker state |
| 171 | */ |
| 172 | typedef struct asl_wrk_ |
| 173 | { |
| 174 | /** Linked list of mqs with pending messages */ |
| 175 | app_rx_mq_elt_t *pending_rx_mqs; |
| 176 | } appsl_wrk_t; |
| 177 | |
Florin Coras | 1553197 | 2018-08-12 23:50:53 -0700 | [diff] [blame] | 178 | typedef struct app_main_ |
| 179 | { |
| 180 | /** |
| 181 | * Pool from which we allocate all applications |
| 182 | */ |
| 183 | application_t *app_pool; |
| 184 | |
| 185 | /** |
Florin Coras | 1553197 | 2018-08-12 23:50:53 -0700 | [diff] [blame] | 186 | * Hash table of apps by api client index |
| 187 | */ |
| 188 | uword *app_by_api_client_index; |
| 189 | |
| 190 | /** |
| 191 | * Hash table of builtin apps by name |
| 192 | */ |
| 193 | uword *app_by_name; |
Nathan Skrzypczak | 79f8953 | 2019-09-13 11:08:13 +0200 | [diff] [blame] | 194 | |
| 195 | /** |
| 196 | * Pool from which we allocate certificates (key, cert) |
| 197 | */ |
| 198 | app_cert_key_pair_t *cert_key_pair_store; |
Florin Coras | 79ba25d | 2019-10-20 19:32:47 -0700 | [diff] [blame] | 199 | |
| 200 | /* |
| 201 | * Last registered crypto engine type |
| 202 | */ |
| 203 | crypto_engine_type_t last_crypto_engine; |
Florin Coras | 41d5f54 | 2021-01-15 13:49:33 -0800 | [diff] [blame] | 204 | |
| 205 | /** |
| 206 | * App sublayer per-worker state |
| 207 | */ |
| 208 | appsl_wrk_t *wrk; |
Florin Coras | 1553197 | 2018-08-12 23:50:53 -0700 | [diff] [blame] | 209 | } app_main_t; |
| 210 | |
Florin Coras | 1553197 | 2018-08-12 23:50:53 -0700 | [diff] [blame] | 211 | typedef struct app_init_args_ |
| 212 | { |
| 213 | #define _(_type, _name) _type _name; |
| 214 | foreach_app_init_args |
| 215 | #undef _ |
| 216 | } app_init_args_t; |
| 217 | |
| 218 | typedef struct _vnet_app_worker_add_del_args |
| 219 | { |
| 220 | u32 app_index; /**< App for which a new worker is requested */ |
Florin Coras | 349f8ca | 2018-11-20 16:52:49 -0800 | [diff] [blame] | 221 | u32 wrk_map_index; /**< Index to delete or return value if add */ |
Florin Coras | c1f5a43 | 2018-11-20 11:31:26 -0800 | [diff] [blame] | 222 | u32 api_client_index; /**< Binary API client index */ |
Florin Coras | 1553197 | 2018-08-12 23:50:53 -0700 | [diff] [blame] | 223 | ssvm_private_t *segment; /**< First segment in segment manager */ |
Florin Coras | fa76a76 | 2018-11-29 12:40:10 -0800 | [diff] [blame] | 224 | u64 segment_handle; /**< Handle for the segment */ |
Florin Coras | 1553197 | 2018-08-12 23:50:53 -0700 | [diff] [blame] | 225 | svm_msg_q_t *evt_q; /**< Worker message queue */ |
| 226 | u8 is_add; /**< Flag set if addition */ |
| 227 | } vnet_app_worker_add_del_args_t; |
| 228 | |
Florin Coras | cea194d | 2017-10-02 00:18:51 -0700 | [diff] [blame] | 229 | #define APP_INVALID_INDEX ((u32)~0) |
| 230 | #define APP_NS_INVALID_INDEX ((u32)~0) |
Florin Coras | c87c91d | 2017-08-16 19:55:49 -0700 | [diff] [blame] | 231 | #define APP_INVALID_SEGMENT_MANAGER_INDEX ((u32) ~0) |
| 232 | |
Florin Coras | c9940fc | 2019-02-05 20:55:11 -0800 | [diff] [blame] | 233 | app_listener_t *app_listener_get (application_t * app, u32 al_index); |
| 234 | int app_listener_alloc_and_init (application_t * app, |
| 235 | session_endpoint_cfg_t * sep, |
| 236 | app_listener_t ** listener); |
| 237 | void app_listener_cleanup (app_listener_t * app_listener); |
| 238 | session_handle_t app_listener_handle (app_listener_t * app_listener); |
| 239 | app_listener_t *app_listener_lookup (application_t * app, |
| 240 | session_endpoint_cfg_t * sep); |
Florin Coras | 87d6633 | 2019-06-11 12:31:31 -0700 | [diff] [blame] | 241 | |
| 242 | /** |
| 243 | * Get app listener handle for listening session |
| 244 | * |
| 245 | * For a given listening session, this can return either the session |
| 246 | * handle of the app listener associated to the listening session or, |
| 247 | * if no such app listener exists, the session's handle |
| 248 | * |
| 249 | * @param ls listening session |
| 250 | * @return app listener or listening session handle |
| 251 | */ |
| 252 | session_handle_t app_listen_session_handle (session_t * ls); |
| 253 | /** |
| 254 | * Get app listener for listener session handle |
| 255 | * |
| 256 | * Should only be called on handles that have an app listener, i.e., |
| 257 | * were obtained at the end of a @ref vnet_listen call. |
| 258 | * |
| 259 | * @param handle handle of the app listener. This is the handle of |
| 260 | * either the global or local listener |
| 261 | * @return pointer to app listener or 0 |
| 262 | */ |
Florin Coras | c9940fc | 2019-02-05 20:55:11 -0800 | [diff] [blame] | 263 | app_listener_t *app_listener_get_w_handle (session_handle_t handle); |
| 264 | app_listener_t *app_listener_get_w_session (session_t * ls); |
Florin Coras | c9940fc | 2019-02-05 20:55:11 -0800 | [diff] [blame] | 265 | session_t *app_listener_get_session (app_listener_t * al); |
Florin Coras | d4295e6 | 2019-02-22 13:11:38 -0800 | [diff] [blame] | 266 | session_t *app_listener_get_local_session (app_listener_t * al); |
Florin Coras | c9940fc | 2019-02-05 20:55:11 -0800 | [diff] [blame] | 267 | |
Dave Barach | 68b0fb0 | 2017-02-28 15:15:56 -0500 | [diff] [blame] | 268 | application_t *application_get (u32 index); |
Florin Coras | e04c299 | 2017-03-01 08:17:34 -0800 | [diff] [blame] | 269 | application_t *application_get_if_valid (u32 index); |
Dave Barach | 68b0fb0 | 2017-02-28 15:15:56 -0500 | [diff] [blame] | 270 | application_t *application_lookup (u32 api_client_index); |
Florin Coras | 0bee9ce | 2018-03-22 21:24:31 -0700 | [diff] [blame] | 271 | application_t *application_lookup_name (const u8 * name); |
Florin Coras | 1553197 | 2018-08-12 23:50:53 -0700 | [diff] [blame] | 272 | app_worker_t *application_get_worker (application_t * app, u32 wrk_index); |
| 273 | app_worker_t *application_get_default_worker (application_t * app); |
Florin Coras | c9940fc | 2019-02-05 20:55:11 -0800 | [diff] [blame] | 274 | app_worker_t *application_listener_select_worker (session_t * ls); |
Florin Coras | 623eb56 | 2019-02-03 19:28:34 -0800 | [diff] [blame] | 275 | int application_change_listener_owner (session_t * s, app_worker_t * app_wrk); |
Dave Barach | 52851e6 | 2017-08-07 09:35:25 -0400 | [diff] [blame] | 276 | int application_is_proxy (application_t * app); |
Florin Coras | 7999e83 | 2017-10-31 01:51:04 -0700 | [diff] [blame] | 277 | int application_is_builtin (application_t * app); |
| 278 | int application_is_builtin_proxy (application_t * app); |
Florin Coras | cea194d | 2017-10-02 00:18:51 -0700 | [diff] [blame] | 279 | u32 application_session_table (application_t * app, u8 fib_proto); |
| 280 | u32 application_local_session_table (application_t * app); |
Florin Coras | 053a0e4 | 2018-11-13 15:52:38 -0800 | [diff] [blame] | 281 | const u8 *application_name_from_index (u32 app_or_wrk); |
Florin Coras | cea194d | 2017-10-02 00:18:51 -0700 | [diff] [blame] | 282 | u8 application_has_local_scope (application_t * app); |
| 283 | u8 application_has_global_scope (application_t * app); |
Florin Coras | 7999e83 | 2017-10-31 01:51:04 -0700 | [diff] [blame] | 284 | void application_setup_proxy (application_t * app); |
| 285 | void application_remove_proxy (application_t * app); |
| 286 | |
Florin Coras | 88001c6 | 2019-04-24 14:44:46 -0700 | [diff] [blame] | 287 | segment_manager_props_t *application_get_segment_manager_properties (u32 |
| 288 | app_index); |
Florin Coras | ab2f6db | 2018-08-31 14:31:41 -0700 | [diff] [blame] | 289 | |
Florin Coras | 88001c6 | 2019-04-24 14:44:46 -0700 | [diff] [blame] | 290 | segment_manager_props_t |
Florin Coras | a332c46 | 2018-01-31 06:52:17 -0800 | [diff] [blame] | 291 | * application_segment_manager_properties (application_t * app); |
| 292 | |
Florin Coras | 41d5f54 | 2021-01-15 13:49:33 -0800 | [diff] [blame] | 293 | svm_msg_q_t *application_rx_mq_get (application_t *app, u32 mq_index); |
| 294 | u8 application_use_private_rx_mqs (void); |
| 295 | fifo_segment_t *application_get_rx_mqs_segment (application_t *app); |
| 296 | void application_enable_rx_mqs_nodes (u8 is_en); |
| 297 | |
Florin Coras | ab2f6db | 2018-08-31 14:31:41 -0700 | [diff] [blame] | 298 | /* |
Florin Coras | 623eb56 | 2019-02-03 19:28:34 -0800 | [diff] [blame] | 299 | * App worker |
| 300 | */ |
| 301 | |
| 302 | app_worker_t *app_worker_alloc (application_t * app); |
| 303 | int application_alloc_worker_and_init (application_t * app, |
| 304 | app_worker_t ** wrk); |
| 305 | app_worker_t *app_worker_get (u32 wrk_index); |
| 306 | app_worker_t *app_worker_get_if_valid (u32 wrk_index); |
| 307 | application_t *app_worker_get_app (u32 wrk_index); |
| 308 | int app_worker_own_session (app_worker_t * app_wrk, session_t * s); |
| 309 | void app_worker_free (app_worker_t * app_wrk); |
Florin Coras | c9940fc | 2019-02-05 20:55:11 -0800 | [diff] [blame] | 310 | int app_worker_connect_session (app_worker_t * app, session_endpoint_t * tep, |
| 311 | u32 api_context); |
| 312 | int app_worker_start_listen (app_worker_t * app_wrk, app_listener_t * lstnr); |
| 313 | int app_worker_stop_listen (app_worker_t * app_wrk, app_listener_t * al); |
Florin Coras | a27a46e | 2019-02-18 13:02:28 -0800 | [diff] [blame] | 314 | int app_worker_init_accepted (session_t * s); |
| 315 | int app_worker_accept_notify (app_worker_t * app_wrk, session_t * s); |
| 316 | int app_worker_init_connected (app_worker_t * app_wrk, session_t * s); |
| 317 | int app_worker_connect_notify (app_worker_t * app_wrk, session_t * s, |
Florin Coras | 00e01d3 | 2019-10-21 16:07:46 -0700 | [diff] [blame] | 318 | session_error_t err, u32 opaque); |
Florin Coras | d50ff7f | 2020-04-16 04:30:22 +0000 | [diff] [blame] | 319 | int app_worker_add_half_open (app_worker_t * app_wrk, transport_proto_t tp, |
| 320 | session_handle_t ho_handle, |
| 321 | session_handle_t wrk_handle); |
| 322 | int app_worker_del_half_open (app_worker_t * app_wrk, transport_proto_t tp, |
| 323 | session_handle_t ho_handle); |
| 324 | u64 app_worker_lookup_half_open (app_worker_t * app_wrk, transport_proto_t tp, |
| 325 | session_handle_t ho_handle); |
Florin Coras | bf7ce2c | 2019-03-06 14:44:42 -0800 | [diff] [blame] | 326 | int app_worker_close_notify (app_worker_t * app_wrk, session_t * s); |
Florin Coras | 692b949 | 2019-07-12 15:01:53 -0700 | [diff] [blame] | 327 | int app_worker_transport_closed_notify (app_worker_t * app_wrk, |
| 328 | session_t * s); |
Florin Coras | 69b68ef | 2019-04-02 11:38:51 -0700 | [diff] [blame] | 329 | int app_worker_reset_notify (app_worker_t * app_wrk, session_t * s); |
Florin Coras | 70f26d5 | 2019-07-08 11:47:18 -0700 | [diff] [blame] | 330 | int app_worker_cleanup_notify (app_worker_t * app_wrk, session_t * s, |
| 331 | session_cleanup_ntf_t ntf); |
Florin Coras | 49568af | 2019-07-31 16:46:24 -0700 | [diff] [blame] | 332 | int app_worker_migrate_notify (app_worker_t * app_wrk, session_t * s, |
| 333 | session_handle_t new_sh); |
Florin Coras | bf7ce2c | 2019-03-06 14:44:42 -0800 | [diff] [blame] | 334 | int app_worker_builtin_rx (app_worker_t * app_wrk, session_t * s); |
Florin Coras | 0e573f5 | 2019-05-07 16:28:16 -0700 | [diff] [blame] | 335 | int app_worker_builtin_tx (app_worker_t * app_wrk, session_t * s); |
Ryujiro Shibuya | d8f48e2 | 2020-01-22 12:11:42 +0000 | [diff] [blame] | 336 | int app_worker_session_fifo_tuning (app_worker_t * app_wrk, session_t * s, |
| 337 | svm_fifo_t * f, |
| 338 | session_ft_action_t act, u32 len); |
Florin Coras | 623eb56 | 2019-02-03 19:28:34 -0800 | [diff] [blame] | 339 | segment_manager_t *app_worker_get_listen_segment_manager (app_worker_t *, |
| 340 | session_t *); |
| 341 | segment_manager_t *app_worker_get_connect_segment_manager (app_worker_t *); |
| 342 | segment_manager_t |
| 343 | * app_worker_get_or_alloc_connect_segment_manager (app_worker_t *); |
| 344 | int app_worker_alloc_connects_segment_manager (app_worker_t * app); |
Florin Coras | 2b81e3c | 2019-02-27 07:55:46 -0800 | [diff] [blame] | 345 | int app_worker_add_segment_notify (app_worker_t * app_wrk, |
| 346 | u64 segment_handle); |
| 347 | int app_worker_del_segment_notify (app_worker_t * app_wrk, |
| 348 | u64 segment_handle); |
Florin Coras | 623eb56 | 2019-02-03 19:28:34 -0800 | [diff] [blame] | 349 | u32 app_worker_n_listeners (app_worker_t * app); |
| 350 | session_t *app_worker_first_listener (app_worker_t * app, |
| 351 | u8 fib_proto, u8 transport_proto); |
Florin Coras | 623eb56 | 2019-02-03 19:28:34 -0800 | [diff] [blame] | 352 | int app_worker_send_event (app_worker_t * app, session_t * s, u8 evt); |
| 353 | int app_worker_lock_and_send_event (app_worker_t * app, session_t * s, |
| 354 | u8 evt_type); |
| 355 | session_t *app_worker_proxy_listener (app_worker_t * app, u8 fib_proto, |
| 356 | u8 transport_proto); |
Florin Coras | c8e812f | 2020-05-14 05:32:18 +0000 | [diff] [blame] | 357 | void app_worker_del_detached_sm (app_worker_t * app_wrk, u32 sm_index); |
Florin Coras | 623eb56 | 2019-02-03 19:28:34 -0800 | [diff] [blame] | 358 | u8 *format_app_worker (u8 * s, va_list * args); |
| 359 | u8 *format_app_worker_listener (u8 * s, va_list * args); |
Nathan Skrzypczak | de6caf4 | 2019-10-09 14:41:48 +0200 | [diff] [blame] | 360 | u8 *format_crypto_engine (u8 * s, va_list * args); |
| 361 | u8 *format_crypto_context (u8 * s, va_list * args); |
Florin Coras | 623eb56 | 2019-02-03 19:28:34 -0800 | [diff] [blame] | 362 | void app_worker_format_connects (app_worker_t * app_wrk, int verbose); |
Florin Coras | c1a4265 | 2019-02-08 18:27:29 -0800 | [diff] [blame] | 363 | int vnet_app_worker_add_del (vnet_app_worker_add_del_args_t * a); |
Florin Coras | 371ca50 | 2018-02-21 12:07:41 -0800 | [diff] [blame] | 364 | |
Florin Coras | 371ca50 | 2018-02-21 12:07:41 -0800 | [diff] [blame] | 365 | uword unformat_application_proto (unformat_input_t * input, va_list * args); |
Florin Coras | f8f516a | 2018-02-08 15:10:09 -0800 | [diff] [blame] | 366 | |
Nathan Skrzypczak | 79f8953 | 2019-09-13 11:08:13 +0200 | [diff] [blame] | 367 | app_cert_key_pair_t *app_cert_key_pair_get (u32 index); |
| 368 | app_cert_key_pair_t *app_cert_key_pair_get_if_valid (u32 index); |
| 369 | app_cert_key_pair_t *app_cert_key_pair_get_default (); |
Florin Coras | 458089b | 2019-08-21 16:20:44 -0700 | [diff] [blame] | 370 | |
| 371 | /* Needed while we support both bapi and mq ctrl messages */ |
| 372 | int mq_send_session_bound_cb (u32 app_wrk_index, u32 api_context, |
| 373 | session_handle_t handle, int rv); |
| 374 | int mq_send_session_connected_cb (u32 app_wrk_index, u32 api_context, |
Florin Coras | 00e01d3 | 2019-10-21 16:07:46 -0700 | [diff] [blame] | 375 | session_t * s, session_error_t err); |
Florin Coras | 458089b | 2019-08-21 16:20:44 -0700 | [diff] [blame] | 376 | void mq_send_unlisten_reply (app_worker_t * app_wrk, session_handle_t sh, |
| 377 | u32 context, int rv); |
| 378 | |
Florin Coras | 79ba25d | 2019-10-20 19:32:47 -0700 | [diff] [blame] | 379 | crypto_engine_type_t app_crypto_engine_type_add (void); |
| 380 | u8 app_crypto_engine_n_types (void); |
| 381 | |
Dave Barach | 68b0fb0 | 2017-02-28 15:15:56 -0500 | [diff] [blame] | 382 | #endif /* SRC_VNET_SESSION_APPLICATION_H_ */ |
| 383 | |
| 384 | /* |
| 385 | * fd.io coding-style-patch-verification: ON |
| 386 | * |
| 387 | * Local Variables: |
| 388 | * eval: (c-set-style "gnu") |
| 389 | * End: |
| 390 | */ |