X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvnet%2Fapi_errno.h;h=5859bb92d3ef4ea8f84afede95dd24a50a650afa;hb=756cd9441752fc8f84104c9ee19099506ba89f85;hp=ed8e7bbb64985c8364f57e029ae9bbd4d0517939;hpb=3d460bd9bed8e1b77609ef404018ecfac7c29e9e;p=vpp.git diff --git a/src/vnet/api_errno.h b/src/vnet/api_errno.h index ed8e7bbb649..5859bb92d3e 100644 --- a/src/vnet/api_errno.h +++ b/src/vnet/api_errno.h @@ -15,6 +15,10 @@ #ifndef included_vnet_api_errno_h #define included_vnet_api_errno_h +#include +#include +#include + #define foreach_vnet_api_error \ _(UNSPECIFIED, -1, "Unspecified Error") \ _(INVALID_SW_IF_INDEX, -2, "Invalid sw_if_index") \ @@ -136,7 +140,9 @@ _(ACL_IN_USE_OUTBOUND, -143, "Outbound ACL in use") \ _(INIT_FAILED, -144, "Initialization Failed") \ _(NETLINK_ERROR, -145, "netlink error") \ _(BIER_BSL_UNSUP, -146, "BIER bit-string-length unsupported") \ -_(INSTANCE_IN_USE, -147, "Instance in use") +_(INSTANCE_IN_USE, -147, "Instance in use") \ +_(INVALID_SESSION_ID, -148, "session ID out of range") \ +_(ACL_IN_USE_BY_LOOKUP_CONTEXT, -149, "ACL in use by a lookup context") \ typedef enum { @@ -146,6 +152,30 @@ typedef enum VNET_API_N_ERROR, } vnet_api_error_t; +/* *INDENT-OFF* */ +static inline u8 * +format_vnet_api_errno (u8 * s, va_list * args) +{ + vnet_api_error_t api_error = va_arg (*args, vnet_api_error_t); +#ifdef _ +#undef _ +#endif +#define _(a, b, c) \ + case b: \ + s = format (s, "%s", c); \ + break; + switch (api_error) + { + foreach_vnet_api_error + default: + s = format (s, "UNKNOWN"); + break; + } + return s; +#undef _ +} +/* *INDENT-ON* */ + #endif /* included_vnet_api_errno_h */ /*