summaryrefslogtreecommitdiffstats
path: root/src/plugins/hs_apps/sapi/vpp_echo_common.c
diff options
context:
space:
mode:
authorDave Wallace <dwallacelf@gmail.com>2019-09-19 20:38:44 +0000
committerDave Barach <openvpp@barachs.net>2019-09-20 13:49:44 +0000
commit0e402a98b20fbb7c5b715abd038c244c539bad36 (patch)
treebbf21f8c1f7bae497fb7e2aabaa77224a4fdff44 /src/plugins/hs_apps/sapi/vpp_echo_common.c
parent4e323cbdbd57fcd77db68e295f639288441ef3e3 (diff)
hsa: refactor vpp_echo failure handling
- Return unique value for each failure condition - Last failure value returned - All failures included in description - Output failure value and description Type: test Signed-off-by: Dave Wallace <dwallacelf@gmail.com> Change-Id: I72d5e7f660ad4765c468874421622607af6ae3d1 Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
Diffstat (limited to 'src/plugins/hs_apps/sapi/vpp_echo_common.c')
-rw-r--r--src/plugins/hs_apps/sapi/vpp_echo_common.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/plugins/hs_apps/sapi/vpp_echo_common.c b/src/plugins/hs_apps/sapi/vpp_echo_common.c
index 013affd0420..03ed278d497 100644
--- a/src/plugins/hs_apps/sapi/vpp_echo_common.c
+++ b/src/plugins/hs_apps/sapi/vpp_echo_common.c
@@ -18,6 +18,12 @@
#include <hs_apps/sapi/vpp_echo_common.h>
+char *echo_fail_code_str[] = {
+#define _(sym, str) str,
+ foreach_echo_fail_code
+#undef _
+};
+
/*
*
* Format functions
@@ -487,7 +493,8 @@ echo_get_session_from_handle (echo_main_t * em, u64 handle)
clib_spinlock_unlock (&em->sid_vpp_handles_lock);
if (!p)
{
- ECHO_FAIL ("unknown handle 0x%lx", handle);
+ ECHO_FAIL (ECHO_FAIL_GET_SESSION_FROM_HANDLE,
+ "unknown handle 0x%lx", handle);
return 0;
}
return pool_elt_at_index (em->sessions, p[0]);