summaryrefslogtreecommitdiffstats
path: root/src/vnet/dev/error.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/vnet/dev/error.c')
-rw-r--r--src/vnet/dev/error.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/vnet/dev/error.c b/src/vnet/dev/error.c
index df9c6d364e7..4e057010af0 100644
--- a/src/vnet/dev/error.c
+++ b/src/vnet/dev/error.c
@@ -6,6 +6,7 @@
#include <vnet/ethernet/ethernet.h>
#include <vnet/dev/dev.h>
#include <vnet/dev/counters.h>
+#include <vnet/flow/flow.h>
clib_error_t *
vnet_dev_port_err (vlib_main_t *vm, vnet_dev_port_t *port, vnet_dev_rv_t rv,
@@ -27,3 +28,27 @@ vnet_dev_port_err (vlib_main_t *vm, vnet_dev_port_t *port, vnet_dev_rv_t rv,
vec_free (s);
return err;
}
+
+int
+vnet_dev_flow_err (vlib_main_t *vm, vnet_dev_rv_t rv)
+{
+ if (rv == VNET_DEV_OK)
+ return 0;
+
+ switch (rv)
+ {
+ /* clang-format off */
+#define _(n, e, s) \
+ case VNET_DEV_ERR_##e: \
+ return VNET_FLOW_ERROR_##e;
+ foreach_flow_error;
+#undef _
+ /* clang-format on */
+ default:
+ ASSERT (0);
+ }
+
+ ASSERT (0);
+
+ return 0;
+}