diff options
author | Florin Coras <fcoras@cisco.com> | 2021-04-19 17:34:54 -0700 |
---|---|---|
committer | Damjan Marion <dmarion@me.com> | 2021-04-22 11:41:38 +0000 |
commit | 4ac258497303c1cbca539e04ef5f732eed24a5c4 (patch) | |
tree | 6549763ad7e3e04bc5ce875cf5a2dc986aa95c39 /src/vnet/session/session_node.c | |
parent | 5cfe45211ac7977ab9bf07b817fe9a5d00226eb3 (diff) |
vcl session: extended connect/listen configuration
Type: feature
Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ic8d9386fef37ffd3446aaeb93a96ee6d60633831
Diffstat (limited to 'src/vnet/session/session_node.c')
-rw-r--r-- | src/vnet/session/session_node.c | 36 |
1 files changed, 35 insertions, 1 deletions
diff --git a/src/vnet/session/session_node.c b/src/vnet/session/session_node.c index 22ab3e8c064..a4db02362d3 100644 --- a/src/vnet/session/session_node.c +++ b/src/vnet/session/session_node.c @@ -33,6 +33,29 @@ return; \ } +static transport_endpt_ext_cfg_t * +session_mq_get_ext_config (application_t *app, uword offset) +{ + svm_fifo_chunk_t *c; + fifo_segment_t *fs; + + fs = application_get_rx_mqs_segment (app); + c = fs_chunk_ptr (fs->h, offset); + return (transport_endpt_ext_cfg_t *) c->data; +} + +static void +session_mq_free_ext_config (application_t *app, uword offset) +{ + u32 ctrl_thread = vlib_num_workers () ? 1 : 0; + svm_fifo_chunk_t *c; + fifo_segment_t *fs; + + fs = application_get_rx_mqs_segment (app); + c = fs_chunk_ptr (fs->h, offset); + fifo_segment_collect_chunk (fs, ctrl_thread, c); +} + static void session_mq_listen_handler (void *data) { @@ -61,12 +84,17 @@ session_mq_listen_handler (void *data) a->wrk_map_index = mp->wrk_index; a->sep_ext.transport_flags = mp->flags; + if (mp->ext_config) + a->sep_ext.ext_cfg = session_mq_get_ext_config (app, mp->ext_config); + if ((rv = vnet_listen (a))) clib_warning ("listen returned: %U", format_session_error, rv); app_wrk = application_get_worker (app, mp->wrk_index); mq_send_session_bound_cb (app_wrk->wrk_index, mp->context, a->handle, rv); - return; + + if (mp->ext_config) + session_mq_free_ext_config (app, mp->ext_config); } static void @@ -135,6 +163,9 @@ session_mq_connect_handler (void *data) a->app_index = app->app_index; a->wrk_map_index = mp->wrk_index; + if (mp->ext_config) + a->sep_ext.ext_cfg = session_mq_get_ext_config (app, mp->ext_config); + if ((rv = vnet_connect (a))) { clib_warning ("connect returned: %U", format_session_error, rv); @@ -142,6 +173,9 @@ session_mq_connect_handler (void *data) mq_send_session_connected_cb (app_wrk->wrk_index, mp->context, 0, rv); } + if (mp->ext_config) + session_mq_free_ext_config (app, mp->ext_config); + vec_free (a->sep_ext.hostname); } |