diff options
author | Nathan Skrzypczak <nathan.skrzypczak@gmail.com> | 2019-09-12 16:02:13 +0200 |
---|---|---|
committer | Florin Coras <florin.coras@gmail.com> | 2019-10-08 01:12:24 +0000 |
commit | 8095b602c79c411999f04ded541db918cf1fabe0 (patch) | |
tree | 7a4ddade5c1c6fd00bdf0c340c67918dbfaa0966 /src/plugins/hs_apps/sapi/vpp_echo_proto_tcp.c | |
parent | caa7acf5c55a78ef4f7addfb94da0ad788f59a75 (diff) |
hsa: make vpp_echo use mq instead of bapi
Type: refactor
Change-Id: I4f370b09e22dbbc8920272df9a042dae04825bfc
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
Diffstat (limited to 'src/plugins/hs_apps/sapi/vpp_echo_proto_tcp.c')
-rw-r--r-- | src/plugins/hs_apps/sapi/vpp_echo_proto_tcp.c | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/src/plugins/hs_apps/sapi/vpp_echo_proto_tcp.c b/src/plugins/hs_apps/sapi/vpp_echo_proto_tcp.c index c68ffafbac6..0854d489a41 100644 --- a/src/plugins/hs_apps/sapi/vpp_echo_proto_tcp.c +++ b/src/plugins/hs_apps/sapi/vpp_echo_proto_tcp.c @@ -97,7 +97,7 @@ tcp_echo_accepted_cb (session_accepted_msg_t * mp, echo_session_t * session) } static void -tcp_echo_disconnected_reply_cb (echo_session_t * s) +tcp_echo_sent_disconnect_cb (echo_session_t * s) { s->session_state = ECHO_SESSION_STATE_CLOSING; } @@ -122,13 +122,31 @@ tcp_echo_reset_cb (session_reset_msg_t * mp, echo_session_t * s) s->session_state = ECHO_SESSION_STATE_CLOSING; } +static void +tls_echo_set_defaults_after_opts_cb () +{ + echo_main_t *em = &echo_main; + if (em->crypto_ctx_engine == TLS_ENGINE_NONE) + em->crypto_ctx_engine = TLS_ENGINE_OPENSSL; +} + echo_proto_cb_vft_t echo_tcp_proto_cb_vft = { .disconnected_cb = tcp_echo_disconnected_cb, .connected_cb = tcp_echo_connected_cb, .accepted_cb = tcp_echo_accepted_cb, .reset_cb = tcp_echo_reset_cb, - .disconnected_reply_cb = tcp_echo_disconnected_reply_cb, + .sent_disconnect_cb = tcp_echo_sent_disconnect_cb, + .cleanup_cb = tcp_echo_cleanup_cb, +}; + +echo_proto_cb_vft_t echo_tls_proto_cb_vft = { + .disconnected_cb = tcp_echo_disconnected_cb, + .connected_cb = tcp_echo_connected_cb, + .accepted_cb = tcp_echo_accepted_cb, + .reset_cb = tcp_echo_reset_cb, + .sent_disconnect_cb = tcp_echo_sent_disconnect_cb, .cleanup_cb = tcp_echo_cleanup_cb, + .set_defaults_after_opts_cb = tls_echo_set_defaults_after_opts_cb, }; ECHO_REGISTER_PROTO (TRANSPORT_PROTO_TCP, echo_tcp_proto_cb_vft); |