diff options
author | Klement Sekera <ksekera@cisco.com> | 2017-11-30 07:00:31 +0100 |
---|---|---|
committer | Dave Wallace <dwallacelf@gmail.com> | 2018-03-16 19:16:02 +0000 |
commit | ff92efe1074e338f91e59d9c27125d102516e7bf (patch) | |
tree | 8ab08f2ff0aa215b509dcf974102cc4a85f60895 /src/vnet | |
parent | ce8805c6a62893ec52a09c6acec48cce32c76706 (diff) |
stats: allow configuring poller delay
This introduces a startup config option for configuring stats poller delay.
Use `stats { interval <seconds> }` to configure the delay at startup.
The default value remains unchanged - 10 seconds.
Change-Id: If12cb1f7f6f1f8ecfa461561bc77847cdf260388
Signed-off-by: Klement Sekera <ksekera@cisco.com>
Diffstat (limited to 'src/vnet')
-rw-r--r-- | src/vnet/api_errno.h | 28 | ||||
-rw-r--r-- | src/vnet/bfd/bfd_cli.c | 16 |
2 files changed, 28 insertions, 16 deletions
diff --git a/src/vnet/api_errno.h b/src/vnet/api_errno.h index 8c509d7a411..f928e0d8aa4 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 <stdarg.h> +#include <vppinfra/types.h> +#include <vppinfra/format.h> + #define foreach_vnet_api_error \ _(UNSPECIFIED, -1, "Unspecified Error") \ _(INVALID_SW_IF_INDEX, -2, "Invalid sw_if_index") \ @@ -147,6 +151,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 */ /* diff --git a/src/vnet/bfd/bfd_cli.c b/src/vnet/bfd/bfd_cli.c index 33492ca8500..cab20a65b0b 100644 --- a/src/vnet/bfd/bfd_cli.c +++ b/src/vnet/bfd/bfd_cli.c @@ -218,22 +218,6 @@ VLIB_CLI_COMMAND (show_bfd_command, static) = { }; /* *INDENT-ON* */ -static u8 * -format_vnet_api_errno (u8 * s, va_list * args) -{ - vnet_api_error_t api_error = va_arg (*args, vnet_api_error_t); -#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; -} - static clib_error_t * bfd_cli_key_add (vlib_main_t * vm, unformat_input_t * input, CLIB_UNUSED (vlib_cli_command_t * lmd)) |