summaryrefslogtreecommitdiffstats
path: root/src/plugins/nat/nat_api.c
diff options
context:
space:
mode:
authorFilip Varga <fivarga@cisco.com>2020-02-13 14:52:18 +0100
committerOle Trøan <otroan@employees.org>2020-02-20 09:29:41 +0000
commit98301bd5603ce691d809759ec444641953cb5caa (patch)
tree00db0e0d15d4faf4d5e3788df736301379e48e9b /src/plugins/nat/nat_api.c
parent1284f8c71da8ec35cba04351cf62cba7bdd7f847 (diff)
nat: user deletion function & extra metrics
Type: improvement Signed-off-by: Filip Varga <fivarga@cisco.com> Change-Id: Ia5dbfe864c18e953ff49147a9a4684d2ca14b96e
Diffstat (limited to 'src/plugins/nat/nat_api.c')
-rw-r--r--src/plugins/nat/nat_api.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/plugins/nat/nat_api.c b/src/plugins/nat/nat_api.c
index 4c162b7433c..d8c2c5fd1c9 100644
--- a/src/plugins/nat/nat_api.c
+++ b/src/plugins/nat/nat_api.c
@@ -741,6 +741,30 @@ vl_api_nat_ha_resync_t_print (vl_api_nat_ha_resync_t * mp, void *handle)
/*** NAT44 ***/
/*************/
static void
+vl_api_nat44_del_user_t_handler (vl_api_nat44_del_user_t * mp)
+{
+ snat_main_t *sm = &snat_main;
+ vl_api_nat44_del_user_reply_t *rmp;
+ ip4_address_t addr;
+ int rv;
+
+ memcpy (&addr.as_u8, mp->ip_address, 4);
+ rv = nat44_user_del (&addr, ntohl (mp->fib_index));
+
+ REPLY_MACRO (VL_API_NAT44_DEL_USER_REPLY);
+}
+
+static void *vl_api_nat44_del_user_t_print
+ (vl_api_nat44_del_user_t * mp, void *handle)
+{
+ u8 *s;
+ s = format (0, "SCRIPT: nat44_del_user ");
+ s = format (s, "ip_address %U fib_index %U ",
+ format_ip4_address, mp->ip_address, ntohl (mp->fib_index));
+ FINISH;
+}
+
+static void
vl_api_nat44_add_del_address_range_t_handler
(vl_api_nat44_add_del_address_range_t * mp)
{
@@ -3119,6 +3143,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_DEL_USER, nat44_del_user) \
_(NAT44_SESSION_CLEANUP, nat44_session_cleanup) \
_(NAT_SET_LOG_LEVEL, nat_set_log_level) \
_(NAT_IPFIX_ENABLE_DISABLE, nat_ipfix_enable_disable) \