Dave Barach | 68b0fb0 | 2017-02-28 15:15:56 -0500 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2017 Cisco and/or its affiliates. |
| 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 | |
Dave Barach | 68b0fb0 | 2017-02-28 15:15:56 -0500 | [diff] [blame] | 19 | #include <vnet/session/session.h> |
Florin Coras | 6cf30ad | 2017-04-04 23:08:23 -0700 | [diff] [blame] | 20 | #include <vnet/session/segment_manager.h> |
Florin Coras | cea194d | 2017-10-02 00:18:51 -0700 | [diff] [blame] | 21 | #include <vnet/session/application_namespace.h> |
Dave Barach | 68b0fb0 | 2017-02-28 15:15:56 -0500 | [diff] [blame] | 22 | |
Florin Coras | 1553197 | 2018-08-12 23:50:53 -0700 | [diff] [blame] | 23 | #define APP_DEBUG 0 |
| 24 | |
| 25 | #if APP_DEBUG > 0 |
| 26 | #define APP_DBG(_fmt, _args...) clib_warning (_fmt, ##_args) |
| 27 | #else |
| 28 | #define APP_DBG(_fmt, _args...) |
| 29 | #endif |
| 30 | |
Dave Barach | 68b0fb0 | 2017-02-28 15:15:56 -0500 | [diff] [blame] | 31 | typedef struct _stream_session_cb_vft |
| 32 | { |
| 33 | /** Notify server of new segment */ |
Florin Coras | b384b54 | 2018-01-15 01:08:33 -0800 | [diff] [blame] | 34 | int (*add_segment_callback) (u32 api_client_index, |
| 35 | const ssvm_private_t * ssvm_seg); |
Florin Coras | f8f516a | 2018-02-08 15:10:09 -0800 | [diff] [blame] | 36 | /** Notify server of new segment */ |
| 37 | int (*del_segment_callback) (u32 api_client_index, |
| 38 | const ssvm_private_t * ssvm_seg); |
Dave Barach | 68b0fb0 | 2017-02-28 15:15:56 -0500 | [diff] [blame] | 39 | |
| 40 | /** Notify server of newly accepted session */ |
| 41 | int (*session_accept_callback) (stream_session_t * new_session); |
| 42 | |
Florin Coras | cea194d | 2017-10-02 00:18:51 -0700 | [diff] [blame] | 43 | /** Connection request callback */ |
Florin Coras | 1553197 | 2018-08-12 23:50:53 -0700 | [diff] [blame] | 44 | int (*session_connected_callback) (u32 app_wrk_index, u32 opaque, |
Dave Barach | 68b0fb0 | 2017-02-28 15:15:56 -0500 | [diff] [blame] | 45 | stream_session_t * s, u8 code); |
| 46 | |
| 47 | /** Notify app that session is closing */ |
| 48 | void (*session_disconnect_callback) (stream_session_t * s); |
| 49 | |
| 50 | /** Notify app that session was reset */ |
| 51 | void (*session_reset_callback) (stream_session_t * s); |
| 52 | |
Florin Coras | 371ca50 | 2018-02-21 12:07:41 -0800 | [diff] [blame] | 53 | /** Direct RX callback for built-in application */ |
| 54 | int (*builtin_app_rx_callback) (stream_session_t * session); |
| 55 | |
| 56 | /** Direct TX callback for built-in application */ |
| 57 | int (*builtin_app_tx_callback) (stream_session_t * session); |
Dave Barach | 68b0fb0 | 2017-02-28 15:15:56 -0500 | [diff] [blame] | 58 | |
Dave Barach | 68b0fb0 | 2017-02-28 15:15:56 -0500 | [diff] [blame] | 59 | } session_cb_vft_t; |
| 60 | |
Florin Coras | 1553197 | 2018-08-12 23:50:53 -0700 | [diff] [blame] | 61 | typedef struct app_worker_ |
Dave Barach | 68b0fb0 | 2017-02-28 15:15:56 -0500 | [diff] [blame] | 62 | { |
Florin Coras | 1553197 | 2018-08-12 23:50:53 -0700 | [diff] [blame] | 63 | /** Worker index in global worker pool*/ |
| 64 | u32 wrk_index; |
Dave Barach | 68b0fb0 | 2017-02-28 15:15:56 -0500 | [diff] [blame] | 65 | |
Florin Coras | 1553197 | 2018-08-12 23:50:53 -0700 | [diff] [blame] | 66 | /** Worker index in app's map pool */ |
| 67 | u32 wrk_map_index; |
Dave Barach | 68b0fb0 | 2017-02-28 15:15:56 -0500 | [diff] [blame] | 68 | |
Florin Coras | 1553197 | 2018-08-12 23:50:53 -0700 | [diff] [blame] | 69 | /** Index of owning app */ |
| 70 | u32 app_index; |
Florin Coras | cea194d | 2017-10-02 00:18:51 -0700 | [diff] [blame] | 71 | |
Dave Barach | 68b0fb0 | 2017-02-28 15:15:56 -0500 | [diff] [blame] | 72 | /** Application listens for events on this svm queue */ |
Florin Coras | 3c2fed5 | 2018-07-04 04:15:05 -0700 | [diff] [blame] | 73 | svm_msg_q_t *event_queue; |
Dave Barach | 68b0fb0 | 2017-02-28 15:15:56 -0500 | [diff] [blame] | 74 | |
Florin Coras | f8f516a | 2018-02-08 15:10:09 -0800 | [diff] [blame] | 75 | /** Segment manager used for outgoing connects issued by the app */ |
Florin Coras | 6cf30ad | 2017-04-04 23:08:23 -0700 | [diff] [blame] | 76 | u32 connects_seg_manager; |
| 77 | |
Florin Coras | c87c91d | 2017-08-16 19:55:49 -0700 | [diff] [blame] | 78 | /** Lookup tables for listeners. Value is segment manager index */ |
Florin Coras | 6cf30ad | 2017-04-04 23:08:23 -0700 | [diff] [blame] | 79 | uword *listeners_table; |
| 80 | |
Florin Coras | 7999e83 | 2017-10-31 01:51:04 -0700 | [diff] [blame] | 81 | /** |
| 82 | * First segment manager has in the the first segment the application's |
Florin Coras | c87c91d | 2017-08-16 19:55:49 -0700 | [diff] [blame] | 83 | * 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] | 84 | * a listener or for connects. |
| 85 | */ |
Florin Coras | 6cf30ad | 2017-04-04 23:08:23 -0700 | [diff] [blame] | 86 | u32 first_segment_manager; |
Florin Coras | 0e9c33b | 2017-08-14 22:33:41 -0700 | [diff] [blame] | 87 | u8 first_segment_manager_in_use; |
Florin Coras | 6cf30ad | 2017-04-04 23:08:23 -0700 | [diff] [blame] | 88 | |
Florin Coras | f8f516a | 2018-02-08 15:10:09 -0800 | [diff] [blame] | 89 | /* |
| 90 | * Local "cut through" connections specific |
| 91 | */ |
| 92 | |
| 93 | /** Segment manager used for incoming "cut through" connects */ |
| 94 | u32 local_segment_manager; |
| 95 | |
| 96 | /** Pool of local listen sessions */ |
| 97 | local_session_t *local_listen_sessions; |
| 98 | |
| 99 | /** Pool of local sessions the app owns (as a server) */ |
| 100 | local_session_t *local_sessions; |
| 101 | |
| 102 | /** Hash table of the app's local connects */ |
| 103 | uword *local_connects; |
Florin Coras | 371ca50 | 2018-02-21 12:07:41 -0800 | [diff] [blame] | 104 | |
Florin Coras | 1553197 | 2018-08-12 23:50:53 -0700 | [diff] [blame] | 105 | u8 app_is_builtin; |
| 106 | } app_worker_t; |
| 107 | |
| 108 | typedef struct app_worker_map_ |
| 109 | { |
| 110 | u32 wrk_index; |
| 111 | } app_worker_map_t; |
| 112 | |
| 113 | typedef struct application_ |
| 114 | { |
| 115 | /** App index in app pool */ |
| 116 | u32 app_index; |
| 117 | |
| 118 | /** Binary API connection index, ~0 if internal */ |
| 119 | u32 api_client_index; |
| 120 | |
| 121 | /** Flags */ |
| 122 | u32 flags; |
| 123 | |
| 124 | /** Callbacks: shoulder-taps for the server/client */ |
| 125 | session_cb_vft_t cb_fns; |
| 126 | |
| 127 | /** Segment manager properties. Shared by all segment managers */ |
| 128 | segment_manager_properties_t sm_properties; |
| 129 | |
| 130 | /** Pool of mappings that keep track of workers associated to this app */ |
| 131 | app_worker_map_t *worker_maps; |
| 132 | |
| 133 | /** Name registered by builtin apps */ |
| 134 | u8 *name; |
| 135 | |
| 136 | /** Namespace the application belongs to */ |
| 137 | u32 ns_index; |
| 138 | |
| 139 | u16 proxied_transports; |
| 140 | |
Florin Coras | 371ca50 | 2018-02-21 12:07:41 -0800 | [diff] [blame] | 141 | /* |
| 142 | * TLS Specific |
| 143 | */ |
| 144 | |
| 145 | /** Certificate to be used for listen sessions */ |
| 146 | u8 *tls_cert; |
| 147 | |
| 148 | /** PEM encoded key */ |
| 149 | u8 *tls_key; |
Florin Coras | 58d36f0 | 2018-03-09 13:05:53 -0800 | [diff] [blame] | 150 | |
| 151 | /** Preferred tls engine */ |
| 152 | u8 tls_engine; |
Dave Barach | 68b0fb0 | 2017-02-28 15:15:56 -0500 | [diff] [blame] | 153 | } application_t; |
| 154 | |
Florin Coras | 1553197 | 2018-08-12 23:50:53 -0700 | [diff] [blame] | 155 | typedef struct app_main_ |
| 156 | { |
| 157 | /** |
| 158 | * Pool from which we allocate all applications |
| 159 | */ |
| 160 | application_t *app_pool; |
| 161 | |
| 162 | /** |
| 163 | * Pool of workers associated to apps |
| 164 | */ |
| 165 | app_worker_t *workers; |
| 166 | |
| 167 | /** |
| 168 | * Hash table of apps by api client index |
| 169 | */ |
| 170 | uword *app_by_api_client_index; |
| 171 | |
| 172 | /** |
| 173 | * Hash table of builtin apps by name |
| 174 | */ |
| 175 | uword *app_by_name; |
| 176 | } app_main_t; |
| 177 | |
| 178 | #define foreach_app_init_args \ |
| 179 | _(u32, api_client_index) \ |
| 180 | _(u8 *, name) \ |
| 181 | _(u64 *, options) \ |
| 182 | _(u8 *, namespace_id) \ |
| 183 | _(session_cb_vft_t *, session_cb_vft) \ |
| 184 | _(u32, app_index) \ |
| 185 | |
| 186 | typedef struct app_init_args_ |
| 187 | { |
| 188 | #define _(_type, _name) _type _name; |
| 189 | foreach_app_init_args |
| 190 | #undef _ |
| 191 | } app_init_args_t; |
| 192 | |
| 193 | typedef struct _vnet_app_worker_add_del_args |
| 194 | { |
| 195 | u32 app_index; /**< App for which a new worker is requested */ |
| 196 | u32 wrk_index; /**< Index to delete or return value if add */ |
| 197 | ssvm_private_t *segment; /**< First segment in segment manager */ |
| 198 | svm_msg_q_t *evt_q; /**< Worker message queue */ |
| 199 | u8 is_add; /**< Flag set if addition */ |
| 200 | } vnet_app_worker_add_del_args_t; |
| 201 | |
Florin Coras | cea194d | 2017-10-02 00:18:51 -0700 | [diff] [blame] | 202 | #define APP_INVALID_INDEX ((u32)~0) |
| 203 | #define APP_NS_INVALID_INDEX ((u32)~0) |
Florin Coras | c87c91d | 2017-08-16 19:55:49 -0700 | [diff] [blame] | 204 | #define APP_INVALID_SEGMENT_MANAGER_INDEX ((u32) ~0) |
| 205 | |
Florin Coras | 1553197 | 2018-08-12 23:50:53 -0700 | [diff] [blame] | 206 | app_worker_t *app_worker_alloc (application_t * app); |
| 207 | int app_worker_alloc_and_init (application_t * app, app_worker_t ** wrk); |
| 208 | app_worker_t *app_worker_get (u32 wrk_index); |
| 209 | app_worker_t *app_worker_get_if_valid (u32 wrk_index); |
| 210 | void app_worker_free (app_worker_t * app_wrk); |
| 211 | int app_worker_start_listen (app_worker_t * app, |
| 212 | session_endpoint_t * tep, |
| 213 | session_handle_t * handle); |
| 214 | int app_worker_stop_listen (session_handle_t handle, u32 app_wrk_index); |
| 215 | int app_worker_open_session (app_worker_t * app, session_endpoint_t * tep, |
| 216 | u32 api_context); |
| 217 | segment_manager_t *app_worker_get_listen_segment_manager (app_worker_t *, |
| 218 | stream_session_t *); |
| 219 | segment_manager_t *app_worker_get_connect_segment_manager (app_worker_t *); |
| 220 | int app_worker_alloc_connects_segment_manager (app_worker_t * app); |
| 221 | int app_worker_add_segment_notify (u32 app_wrk_index, ssvm_private_t * fs); |
| 222 | u32 app_worker_n_listeners (app_worker_t * app); |
| 223 | stream_session_t *app_worker_first_listener (app_worker_t * app, |
| 224 | u8 fib_proto, |
| 225 | u8 transport_proto); |
| 226 | u8 app_worker_application_is_builtin (app_worker_t * app_wrk); |
| 227 | clib_error_t *vnet_app_worker_add_del (vnet_app_worker_add_del_args_t * a); |
| 228 | |
| 229 | application_t *application_alloc (void); |
| 230 | int application_alloc_and_init (app_init_args_t * args); |
| 231 | void application_free (application_t * app); |
Dave Barach | 68b0fb0 | 2017-02-28 15:15:56 -0500 | [diff] [blame] | 232 | application_t *application_get (u32 index); |
Florin Coras | e04c299 | 2017-03-01 08:17:34 -0800 | [diff] [blame] | 233 | application_t *application_get_if_valid (u32 index); |
Dave Barach | 68b0fb0 | 2017-02-28 15:15:56 -0500 | [diff] [blame] | 234 | application_t *application_lookup (u32 api_client_index); |
Florin Coras | 0bee9ce | 2018-03-22 21:24:31 -0700 | [diff] [blame] | 235 | application_t *application_lookup_name (const u8 * name); |
Florin Coras | 1553197 | 2018-08-12 23:50:53 -0700 | [diff] [blame] | 236 | u32 application_index (application_t * app); |
| 237 | app_worker_t *application_get_worker (application_t * app, u32 wrk_index); |
| 238 | app_worker_t *application_get_default_worker (application_t * app); |
Dave Barach | 68b0fb0 | 2017-02-28 15:15:56 -0500 | [diff] [blame] | 239 | int application_api_queue_is_full (application_t * app); |
| 240 | |
Florin Coras | 371ca50 | 2018-02-21 12:07:41 -0800 | [diff] [blame] | 241 | |
Dave Barach | 52851e6 | 2017-08-07 09:35:25 -0400 | [diff] [blame] | 242 | int application_is_proxy (application_t * app); |
Florin Coras | 7999e83 | 2017-10-31 01:51:04 -0700 | [diff] [blame] | 243 | int application_is_builtin (application_t * app); |
| 244 | int application_is_builtin_proxy (application_t * app); |
Florin Coras | cea194d | 2017-10-02 00:18:51 -0700 | [diff] [blame] | 245 | u32 application_session_table (application_t * app, u8 fib_proto); |
| 246 | u32 application_local_session_table (application_t * app); |
Florin Coras | 1553197 | 2018-08-12 23:50:53 -0700 | [diff] [blame] | 247 | u8 *application_name_from_index (u32 app_wrk_index); |
Florin Coras | cea194d | 2017-10-02 00:18:51 -0700 | [diff] [blame] | 248 | u8 application_has_local_scope (application_t * app); |
| 249 | u8 application_has_global_scope (application_t * app); |
Florin Coras | 6011699 | 2018-08-27 09:52:18 -0700 | [diff] [blame] | 250 | u8 application_use_mq_for_ctrl (application_t * app); |
Florin Coras | 7999e83 | 2017-10-31 01:51:04 -0700 | [diff] [blame] | 251 | void application_setup_proxy (application_t * app); |
| 252 | void application_remove_proxy (application_t * app); |
| 253 | |
Florin Coras | a332c46 | 2018-01-31 06:52:17 -0800 | [diff] [blame] | 254 | segment_manager_properties_t *application_get_segment_manager_properties (u32 |
Florin Coras | 1553197 | 2018-08-12 23:50:53 -0700 | [diff] [blame] | 255 | app_wrk_index); |
Florin Coras | a332c46 | 2018-01-31 06:52:17 -0800 | [diff] [blame] | 256 | segment_manager_properties_t |
| 257 | * application_segment_manager_properties (application_t * app); |
| 258 | |
Florin Coras | 1553197 | 2018-08-12 23:50:53 -0700 | [diff] [blame] | 259 | local_session_t *application_alloc_local_session (app_worker_t * app); |
| 260 | void application_free_local_session (app_worker_t * app, |
Florin Coras | f8f516a | 2018-02-08 15:10:09 -0800 | [diff] [blame] | 261 | local_session_t * ls); |
Florin Coras | 1553197 | 2018-08-12 23:50:53 -0700 | [diff] [blame] | 262 | local_session_t *application_get_local_session (app_worker_t * app, |
Florin Coras | f8f516a | 2018-02-08 15:10:09 -0800 | [diff] [blame] | 263 | u32 session_index); |
| 264 | local_session_t *application_get_local_session_from_handle (session_handle_t |
| 265 | handle); |
Florin Coras | 6011699 | 2018-08-27 09:52:18 -0700 | [diff] [blame] | 266 | local_session_t |
| 267 | * application_get_local_listen_session_from_handle (session_handle_t lh); |
Florin Coras | 1553197 | 2018-08-12 23:50:53 -0700 | [diff] [blame] | 268 | int application_start_local_listen (app_worker_t * server, |
| 269 | session_endpoint_t * sep, |
| 270 | session_handle_t * handle); |
| 271 | int application_stop_local_listen (session_handle_t lh, u32 app_wrk_index); |
| 272 | int application_local_session_connect (app_worker_t * client, |
| 273 | app_worker_t * server, |
Florin Coras | f8f516a | 2018-02-08 15:10:09 -0800 | [diff] [blame] | 274 | local_session_t * ll, u32 opaque); |
| 275 | int application_local_session_connect_notify (local_session_t * ls); |
Florin Coras | 1553197 | 2018-08-12 23:50:53 -0700 | [diff] [blame] | 276 | int application_local_session_disconnect (u32 app_wrk_index, |
Florin Coras | f8f516a | 2018-02-08 15:10:09 -0800 | [diff] [blame] | 277 | local_session_t * ls); |
Florin Coras | 1553197 | 2018-08-12 23:50:53 -0700 | [diff] [blame] | 278 | int application_local_session_disconnect_w_index (u32 app_wrk_index, |
Florin Coras | f6647e0 | 2018-03-23 22:56:43 -0700 | [diff] [blame] | 279 | u32 ls_index); |
Florin Coras | 1553197 | 2018-08-12 23:50:53 -0700 | [diff] [blame] | 280 | void application_local_sessions_free (app_worker_t * app); |
Florin Coras | f8f516a | 2018-02-08 15:10:09 -0800 | [diff] [blame] | 281 | |
Florin Coras | 1553197 | 2018-08-12 23:50:53 -0700 | [diff] [blame] | 282 | int application_send_event (app_worker_t * app, stream_session_t * s, u8 evt); |
| 283 | int application_lock_and_send_event (app_worker_t * app, |
Florin Coras | 3c2fed5 | 2018-07-04 04:15:05 -0700 | [diff] [blame] | 284 | stream_session_t * s, u8 evt_type); |
| 285 | |
Florin Coras | f8f516a | 2018-02-08 15:10:09 -0800 | [diff] [blame] | 286 | always_inline u32 |
| 287 | local_session_id (local_session_t * ll) |
| 288 | { |
Florin Coras | 1553197 | 2018-08-12 23:50:53 -0700 | [diff] [blame] | 289 | ASSERT (ll->app_wrk_index < (2 << 16) && ll->session_index < (2 << 16)); |
| 290 | return ((u32) ll->app_wrk_index << 16 | (u32) ll->session_index); |
Florin Coras | f8f516a | 2018-02-08 15:10:09 -0800 | [diff] [blame] | 291 | } |
| 292 | |
| 293 | always_inline void |
Florin Coras | 1553197 | 2018-08-12 23:50:53 -0700 | [diff] [blame] | 294 | local_session_parse_id (u32 ls_id, u32 * app_wrk_index, u32 * session_index) |
Florin Coras | f8f516a | 2018-02-08 15:10:09 -0800 | [diff] [blame] | 295 | { |
Florin Coras | 1553197 | 2018-08-12 23:50:53 -0700 | [diff] [blame] | 296 | *app_wrk_index = ls_id >> 16; |
Florin Coras | f8f516a | 2018-02-08 15:10:09 -0800 | [diff] [blame] | 297 | *session_index = ls_id & 0xFFF; |
| 298 | } |
| 299 | |
| 300 | always_inline void |
| 301 | local_session_parse_handle (session_handle_t handle, u32 * server_index, |
| 302 | u32 * session_index) |
| 303 | { |
| 304 | u32 bottom; |
Florin Coras | 5fda7a3 | 2018-02-14 08:04:31 -0800 | [diff] [blame] | 305 | ASSERT ((handle >> 32) == SESSION_LOCAL_HANDLE_PREFIX); |
Florin Coras | f8f516a | 2018-02-08 15:10:09 -0800 | [diff] [blame] | 306 | bottom = (handle & 0xFFFFFFFF); |
| 307 | local_session_parse_id (bottom, server_index, session_index); |
| 308 | } |
| 309 | |
| 310 | always_inline session_handle_t |
| 311 | application_local_session_handle (local_session_t * ls) |
| 312 | { |
Florin Coras | 5fda7a3 | 2018-02-14 08:04:31 -0800 | [diff] [blame] | 313 | return ((u64) SESSION_LOCAL_HANDLE_PREFIX << 32) |
| 314 | | (u64) local_session_id (ls); |
Florin Coras | f8f516a | 2018-02-08 15:10:09 -0800 | [diff] [blame] | 315 | } |
| 316 | |
| 317 | always_inline local_session_t * |
Florin Coras | 1553197 | 2018-08-12 23:50:53 -0700 | [diff] [blame] | 318 | application_get_local_listen_session (app_worker_t * app, u32 session_index) |
Florin Coras | f8f516a | 2018-02-08 15:10:09 -0800 | [diff] [blame] | 319 | { |
| 320 | return pool_elt_at_index (app->local_listen_sessions, session_index); |
| 321 | } |
| 322 | |
Florin Coras | 5fda7a3 | 2018-02-14 08:04:31 -0800 | [diff] [blame] | 323 | always_inline local_session_t * |
| 324 | application_get_local_listener_w_handle (session_handle_t handle) |
| 325 | { |
Florin Coras | 1553197 | 2018-08-12 23:50:53 -0700 | [diff] [blame] | 326 | u32 server_wrk_index, session_index; |
| 327 | app_worker_t *app; |
| 328 | local_session_parse_handle (handle, &server_wrk_index, &session_index); |
| 329 | app = app_worker_get (server_wrk_index); |
Florin Coras | 5fda7a3 | 2018-02-14 08:04:31 -0800 | [diff] [blame] | 330 | return application_get_local_listen_session (app, session_index); |
| 331 | } |
| 332 | |
Florin Coras | f8f516a | 2018-02-08 15:10:09 -0800 | [diff] [blame] | 333 | always_inline u8 |
| 334 | application_local_session_listener_has_transport (local_session_t * ls) |
| 335 | { |
| 336 | transport_proto_t tp; |
| 337 | tp = session_type_transport_proto (ls->listener_session_type); |
| 338 | return (tp != TRANSPORT_PROTO_NONE); |
| 339 | } |
| 340 | |
Florin Coras | 1553197 | 2018-08-12 23:50:53 -0700 | [diff] [blame] | 341 | void mq_send_local_session_disconnected_cb (u32 app_wrk_index, |
Florin Coras | 9936831 | 2018-08-02 10:45:44 -0700 | [diff] [blame] | 342 | local_session_t * ls); |
Florin Coras | 371ca50 | 2018-02-21 12:07:41 -0800 | [diff] [blame] | 343 | |
Florin Coras | 371ca50 | 2018-02-21 12:07:41 -0800 | [diff] [blame] | 344 | uword unformat_application_proto (unformat_input_t * input, va_list * args); |
Florin Coras | f8f516a | 2018-02-08 15:10:09 -0800 | [diff] [blame] | 345 | |
Dave Barach | 68b0fb0 | 2017-02-28 15:15:56 -0500 | [diff] [blame] | 346 | #endif /* SRC_VNET_SESSION_APPLICATION_H_ */ |
| 347 | |
| 348 | /* |
| 349 | * fd.io coding-style-patch-verification: ON |
| 350 | * |
| 351 | * Local Variables: |
| 352 | * eval: (c-set-style "gnu") |
| 353 | * End: |
| 354 | */ |