aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/tls/tls.c
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2019-03-06 10:44:38 -0800
committerDave Barach <openvpp@barachs.net>2019-03-07 00:47:42 +0000
commitf940f8a40fc41d66a9ab5ea15c574120c49eb92b (patch)
treeaa36c02d567a60d62e6255f872dc736aff2a7515 /src/vnet/tls/tls.c
parentfe97da3203c64461f752e854faa97c69b8d225f4 (diff)
session: use transport custom tx for app transports
Change-Id: I675f7090fa6b2ffdfb4ee748df858bfb7e39ce5a Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/vnet/tls/tls.c')
-rw-r--r--src/vnet/tls/tls.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/src/vnet/tls/tls.c b/src/vnet/tls/tls.c
index df5a0686715..ce62765b7aa 100644
--- a/src/vnet/tls/tls.c
+++ b/src/vnet/tls/tls.c
@@ -415,17 +415,6 @@ tls_session_accept_callback (session_t * tls_session)
}
int
-tls_app_tx_callback (session_t * app_session)
-{
- tls_ctx_t *ctx;
- if (PREDICT_FALSE (app_session->session_state == SESSION_STATE_CLOSED))
- return 0;
- ctx = tls_ctx_get (app_session->connection_index);
- tls_ctx_write (ctx, app_session);
- return 0;
-}
-
-int
tls_app_rx_callback (session_t * tls_session)
{
tls_ctx_t *ctx;
@@ -501,7 +490,6 @@ static session_cb_vft_t tls_app_cb_vft = {
.add_segment_callback = tls_add_segment_callback,
.del_segment_callback = tls_del_segment_callback,
.builtin_app_rx_callback = tls_app_rx_callback,
- .builtin_app_tx_callback = tls_app_tx_callback,
};
/* *INDENT-ON* */
@@ -663,6 +651,18 @@ tls_listener_get (u32 listener_index)
return &ctx->connection;
}
+int
+tls_custom_tx_callback (void *session)
+{
+ session_t *app_session = (session_t *) session;
+ tls_ctx_t *ctx;
+ if (PREDICT_FALSE (app_session->session_state == SESSION_STATE_CLOSED))
+ return 0;
+ ctx = tls_ctx_get (app_session->connection_index);
+ tls_ctx_write (ctx, app_session);
+ return 0;
+}
+
u8 *
format_tls_ctx (u8 * s, va_list * args)
{
@@ -735,6 +735,7 @@ const static transport_proto_vft_t tls_proto = {
.stop_listen = tls_stop_listen,
.get_connection = tls_connection_get,
.get_listener = tls_listener_get,
+ .custom_tx = tls_custom_tx_callback,
.tx_type = TRANSPORT_TX_INTERNAL,
.service_type = TRANSPORT_SERVICE_APP,
.format_connection = format_tls_connection,