| /* SPDX-License-Identifier: Apache-2.0 |
| * Copyright(c) 2022 Cisco Systems, Inc. |
| #include <vppinfra/error.h> |
| #include <vnet/api_errno.h> |
| static char *error_strings[] = { |
| #define _(a, b, c) [-(b)] = c, |
| vnet_error (vnet_error_t rv, char *fmt, ...) |
| clib_error_t *e, *err = 0; |
| e->what = format (e->what, "%s", error_strings[-rv]); |
| e->what = va_format (e->what, fmt, &va); |
| format_vnet_api_errno (u8 *s, va_list *args) |
| vnet_api_error_t api_error = va_arg (*args, vnet_api_error_t); |
| s = format (s, "%s", c); \ |
| foreach_vnet_error default : s = format (s, "UNKNOWN"); |