summaryrefslogtreecommitdiffstats
path: root/src/plugins/nat/nat44_cli.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/nat/nat44_cli.c')
-rw-r--r--src/plugins/nat/nat44_cli.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/plugins/nat/nat44_cli.c b/src/plugins/nat/nat44_cli.c
index e9d3ff5426f..659dbb2247e 100644
--- a/src/plugins/nat/nat44_cli.c
+++ b/src/plugins/nat/nat44_cli.c
@@ -22,6 +22,7 @@
#include <nat/nat_det.h>
#include <nat/nat64.h>
#include <nat/nat_inlines.h>
+#include <nat/nat44/inlines.h>
#include <nat/nat_affinity.h>
#include <vnet/fib/fib_table.h>
#include <nat/nat_ha.h>
@@ -116,6 +117,18 @@ nat_show_workers_commnad_fn (vlib_main_t * vm, unformat_input_t * input,
}
static clib_error_t *
+nat44_session_cleanup_command_fn (vlib_main_t * vm,
+ unformat_input_t * input,
+ vlib_cli_command_t * cmd)
+{
+ clib_error_t *error = 0;
+
+ nat44_force_session_cleanup ();
+
+ return error;
+}
+
+static clib_error_t *
snat_set_log_level_command_fn (vlib_main_t * vm,
unformat_input_t * input,
vlib_cli_command_t * cmd)
@@ -1979,6 +1992,19 @@ VLIB_CLI_COMMAND (nat_show_timeouts_command, static) = {
/*?
* @cliexpar
* @cliexstart{nat set logging level}
+ * To force garbage collection of nat sessions
+ * vpp# nat44 session cleanup
+ * @cliexend
+?*/
+VLIB_CLI_COMMAND (nat44_session_cleanup_command, static) = {
+ .path = "nat44 session cleanup",
+ .function = nat44_session_cleanup_command_fn,
+ .short_help = "nat44 session cleanup",
+};
+
+/*?
+ * @cliexpar
+ * @cliexstart{nat set logging level}
* To set NAT logging level use:
* Set nat logging level
* @cliexend