aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/nat/nat_api.c
diff options
context:
space:
mode:
authorFilip Varga <fivarga@cisco.com>2020-02-06 15:25:27 +0100
committerOle Trøan <otroan@employees.org>2020-02-07 07:37:05 +0000
commitedf777272b211de3d54f5dc7b211ee84cdb31373 (patch)
treeac18fd5190adb5d7090fdae80a9a296f048d8d80 /src/plugins/nat/nat_api.c
parentb71ef86c7429e81921997e54a526bf666a2e4089 (diff)
nat: api & cli command for forcing session cleanup
Ticket: VPP-1836 Type: feature Signed-off-by: Filip Varga <fivarga@cisco.com> Change-Id: I8f7fc011bac435445a8916a4948d130ca9162f67
Diffstat (limited to 'src/plugins/nat/nat_api.c')
-rw-r--r--src/plugins/nat/nat_api.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/plugins/nat/nat_api.c b/src/plugins/nat/nat_api.c
index d73a0337d2a..4c162b7433c 100644
--- a/src/plugins/nat/nat_api.c
+++ b/src/plugins/nat/nat_api.c
@@ -23,6 +23,7 @@
#include <nat/nat64.h>
#include <nat/nat66.h>
#include <nat/nat_inlines.h>
+#include <nat/nat44/inlines.h>
#include <nat/nat_ha.h>
#include <vlibapi/api.h>
#include <vlibmemory/api.h>
@@ -241,6 +242,30 @@ vl_api_nat_worker_dump_t_print (vl_api_nat_worker_dump_t * mp, void *handle)
}
static void
+vl_api_nat44_session_cleanup_t_handler (vl_api_nat44_session_cleanup_t * mp)
+{
+ snat_main_t *sm = &snat_main;
+ vl_api_nat44_session_cleanup_reply_t *rmp;
+ int rv = 0;
+
+ nat44_force_session_cleanup ();
+
+ REPLY_MACRO (VL_API_NAT44_SESSION_CLEANUP_REPLY);
+}
+
+static void *
+vl_api_nat44_session_cleanup_t_print (vl_api_nat44_session_cleanup_t * mp,
+ void *handle)
+{
+ u8 *s;
+
+ s = format (0, "SCRIPT: nat44_session_cleanup");
+
+ FINISH;
+}
+
+
+static void
vl_api_nat_set_log_level_t_handler (vl_api_nat_set_log_level_t * mp)
{
snat_main_t *sm = &snat_main;
@@ -3094,6 +3119,7 @@ _(NAT_CONTROL_PING, nat_control_ping) \
_(NAT_SHOW_CONFIG, nat_show_config) \
_(NAT_SET_WORKERS, nat_set_workers) \
_(NAT_WORKER_DUMP, nat_worker_dump) \
+_(NAT44_SESSION_CLEANUP, nat44_session_cleanup) \
_(NAT_SET_LOG_LEVEL, nat_set_log_level) \
_(NAT_IPFIX_ENABLE_DISABLE, nat_ipfix_enable_disable) \
_(NAT_SET_TIMEOUTS, nat_set_timeouts) \