diff options
author | Filip Varga <filipvarga89@gmail.com> | 2019-07-31 12:45:48 +0200 |
---|---|---|
committer | Ole Trøan <otroan@employees.org> | 2019-07-31 17:43:33 +0000 |
commit | e6e09a4acef2c38bc31e89c05bd1f40f1829debb (patch) | |
tree | 17047be4ac050426ee113677a24b73644f714047 /src/plugins/nat/nat44_cli.c | |
parent | c343a17df5bba800ecd7cca92acdd2bd1f984ebf (diff) |
nat: elog rewrite for multi-worker support
Type: fix
Change-Id: I04f136a04bc022d223e4bcb5c59920bd1f1fd560
Signed-off-by: Filip Varga <filipvarga89@gmail.com>
Diffstat (limited to 'src/plugins/nat/nat44_cli.c')
-rw-r--r-- | src/plugins/nat/nat44_cli.c | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/src/plugins/nat/nat44_cli.c b/src/plugins/nat/nat44_cli.c index cfa294f2222..4dcfb8d8e57 100644 --- a/src/plugins/nat/nat44_cli.c +++ b/src/plugins/nat/nat44_cli.c @@ -116,6 +116,39 @@ nat_show_workers_commnad_fn (vlib_main_t * vm, unformat_input_t * input, } static clib_error_t * +snat_set_log_level_command_fn (vlib_main_t * vm, + unformat_input_t * input, + vlib_cli_command_t * cmd) +{ + unformat_input_t _line_input, *line_input = &_line_input; + snat_main_t *sm = &snat_main; + u8 log_level = SNAT_LOG_NONE; + clib_error_t *error = 0; + + /* Get a line of input. */ + if (!unformat_user (input, unformat_line_input, line_input)) + return 0; + + if (!unformat (line_input, "level %d", &log_level)) + { + error = clib_error_return (0, "unknown input '%U'", + format_unformat_error, line_input); + goto done; + } + if (log_level > SNAT_LOG_DEBUG) + { + error = clib_error_return (0, "unknown logging level '%d'", log_level); + goto done; + } + sm->log_level = log_level; + +done: + unformat_free (line_input); + + return error; +} + +static clib_error_t * snat_ipfix_logging_enable_disable_command_fn (vlib_main_t * vm, unformat_input_t * input, vlib_cli_command_t * cmd) @@ -1945,6 +1978,19 @@ VLIB_CLI_COMMAND (nat_show_timeouts_command, static) = { /*? * @cliexpar + * @cliexstart{nat set logging level} + * To set NAT logging level use: + * Set nat logging level + * @cliexend +?*/ +VLIB_CLI_COMMAND (snat_set_log_level_command, static) = { + .path = "nat set logging level", + .function = snat_set_log_level_command_fn, + .short_help = "nat set logging level <level>", +}; + +/*? + * @cliexpar * @cliexstart{snat ipfix logging} * To enable NAT IPFIX logging use: * vpp# nat ipfix logging |