diff options
author | Andrew Yourtchenko <ayourtch@gmail.com> | 2017-06-21 11:24:25 +0200 |
---|---|---|
committer | Ole Trøan <otroan@employees.org> | 2017-06-21 20:31:44 +0000 |
commit | eb46754ef6b3efd958a11ea2f0b110eb99ce3b27 (patch) | |
tree | 2aae6193381512af33205c323cf56c0299cfdfc6 /src/plugins/acl/acl.c | |
parent | a2b4ac1c13559b1cdf5088edfad4a68022960b00 (diff) |
acl-plugin: CLI to clear all sessions
It is useful to have the CLI to clear the existing sessions.
There was a work-in-progress CLI but it did not work properly.
Fix it and split into a separate "clear acl-plugin sessions",
and add a unit test into the extended connection-oriented tests.
Change-Id: I55889165ebcee139841fdac88747390903a05394
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
Diffstat (limited to 'src/plugins/acl/acl.c')
-rw-r--r-- | src/plugins/acl/acl.c | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/src/plugins/acl/acl.c b/src/plugins/acl/acl.c index ae1cbf714c1..d9f22d826d4 100644 --- a/src/plugins/acl/acl.c +++ b/src/plugins/acl/acl.c @@ -1828,12 +1828,6 @@ acl_set_aclplugin_fn (vlib_main_t * vm, goto done; } if (unformat (input, "session")) { - if (unformat (input, "clear")) { - acl_main_t *am = &acl_main; - vlib_process_signal_event (am->vlib_main, am->fa_cleaner_node_index, - ACL_FA_CLEANER_DELETE_BY_SW_IF_INDEX, ~0); - goto done; - } if (unformat (input, "table")) { /* The commands here are for tuning/testing. No user-serviceable parts inside */ if (unformat (input, "max-entries")) { @@ -2189,6 +2183,17 @@ acl_show_aclplugin_fn (vlib_main_t * vm, return error; } +static clib_error_t * +acl_clear_aclplugin_fn (vlib_main_t * vm, + unformat_input_t * input, + vlib_cli_command_t * cmd) +{ + clib_error_t *error = 0; + acl_main_t *am = &acl_main; + vlib_process_signal_event (am->vlib_main, am->fa_cleaner_node_index, + ACL_FA_CLEANER_DELETE_BY_SW_IF_INDEX, ~0); + return error; +} /* *INDENT-OFF* */ VLIB_CLI_COMMAND (aclplugin_set_command, static) = { @@ -2202,6 +2207,12 @@ VLIB_CLI_COMMAND (aclplugin_show_command, static) = { .short_help = "show acl-plugin {sessions|acl|interface|tables}", .function = acl_show_aclplugin_fn, }; + +VLIB_CLI_COMMAND (aclplugin_clear_command, static) = { + .path = "clear acl-plugin sessions", + .short_help = "clear acl-plugin sessions", + .function = acl_clear_aclplugin_fn, +}; /* *INDENT-ON* */ |