From 8095b602c79c411999f04ded541db918cf1fabe0 Mon Sep 17 00:00:00 2001 From: Nathan Skrzypczak Date: Thu, 12 Sep 2019 16:02:13 +0200 Subject: hsa: make vpp_echo use mq instead of bapi Type: refactor Change-Id: I4f370b09e22dbbc8920272df9a042dae04825bfc Signed-off-by: Nathan Skrzypczak --- src/plugins/hs_apps/sapi/vpp_echo_common.c | 38 ++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) (limited to 'src/plugins/hs_apps/sapi/vpp_echo_common.c') diff --git a/src/plugins/hs_apps/sapi/vpp_echo_common.c b/src/plugins/hs_apps/sapi/vpp_echo_common.c index d6ee644ea6b..0f6c2ec7135 100644 --- a/src/plugins/hs_apps/sapi/vpp_echo_common.c +++ b/src/plugins/hs_apps/sapi/vpp_echo_common.c @@ -174,6 +174,10 @@ echo_format_app_state (u8 * s, va_list * args) return format (s, "STATE_START"); if (state == STATE_ATTACHED) return format (s, "STATE_ATTACHED"); + if (state == STATE_ATTACHED_NO_CERT) + return format (s, "STATE_ATTACHED_NO_CERT"); + if (state == STATE_ATTACHED_ONE_CERT) + return format (s, "STATE_ATTACHED_ONE_CERT"); if (state == STATE_LISTEN) return format (s, "STATE_LISTEN"); if (state == STATE_READY) @@ -426,6 +430,40 @@ unformat_ip6_address (unformat_input_t * input, va_list * args) } } +u8 * +echo_format_crypto_engine (u8 * s, va_list * args) +{ + u32 state = va_arg (*args, u32); + if (state == TLS_ENGINE_MBEDTLS) + return format (s, "mbedtls"); + if (state == TLS_ENGINE_OPENSSL) + return format (s, "openssl"); + if (state == CRYPTO_ENGINE_PICOTLS) + return format (s, "picotls"); + if (state == CRYPTO_ENGINE_VPP) + return format (s, "vpp"); + else + return format (s, "unknown crypto engine"); +} + +uword +echo_unformat_crypto_engine (unformat_input_t * input, va_list * args) +{ + u8 *a = va_arg (*args, u8 *); + if (unformat (input, "mbedtls")) + *a = TLS_ENGINE_MBEDTLS; + else if (unformat (input, "openssl")) + *a = TLS_ENGINE_OPENSSL; + else if (unformat (input, "picotls")) + *a = CRYPTO_ENGINE_PICOTLS; + else if (unformat (input, "vpp")) + *a = CRYPTO_ENGINE_VPP; + else + return 0; + return 1; +} + + /* * * End of format functions -- cgit 1.2.3-korg