aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/nat/nat_api.c
diff options
context:
space:
mode:
authorFilip Varga <fivarga@cisco.com>2020-04-16 13:20:25 +0200
committerFilip Varga <fivarga@cisco.com>2020-05-04 12:15:02 +0200
commit6bb080f1e54391b161cf211a9cfa3f488f2fd331 (patch)
tree8af5f6df9baaacb2a6f10af8ff51e48f7de0846a /src/plugins/nat/nat_api.c
parent2f1563129ad8d34d365f5ef8620ff76ff7b08e70 (diff)
nat: per vrf session limits
Type: improvement Change-Id: I170256ab47978db34fb0ff6808d9cd54ab872410 Signed-off-by: Filip Varga <fivarga@cisco.com>
Diffstat (limited to 'src/plugins/nat/nat_api.c')
-rw-r--r--src/plugins/nat/nat_api.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/plugins/nat/nat_api.c b/src/plugins/nat/nat_api.c
index a54a4790a20..c58e88bd7f0 100644
--- a/src/plugins/nat/nat_api.c
+++ b/src/plugins/nat/nat_api.c
@@ -242,6 +242,33 @@ vl_api_nat_worker_dump_t_print (vl_api_nat_worker_dump_t * mp, void *handle)
}
static void
+vl_api_nat44_set_session_limit_t_handler (vl_api_nat44_set_session_limit_t *
+ mp)
+{
+ snat_main_t *sm = &snat_main;
+ vl_api_nat44_set_session_limit_reply_t *rmp;
+ int rv = 0;
+
+ rv = nat44_set_session_limit
+ (ntohl (mp->session_limit), ntohl (mp->vrf_id));
+
+ REPLY_MACRO (VL_API_NAT_SET_WORKERS_REPLY);
+}
+
+static void *
+vl_api_nat44_set_session_limit_t_print (vl_api_nat44_set_session_limit_t *
+ mp, void *handle)
+{
+ u8 *s;
+
+ s = format (0, "SCRIPT: nat44_set_session_limit ");
+ s = format (s, "session_limit %d", ntohl (mp->session_limit));
+ s = format (s, "vrf_id %d", ntohl (mp->vrf_id));
+
+ 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;
@@ -3141,6 +3168,7 @@ _(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_SET_SESSION_LIMIT, nat44_set_session_limit) \
_(NAT_SET_LOG_LEVEL, nat_set_log_level) \
_(NAT_IPFIX_ENABLE_DISABLE, nat_ipfix_enable_disable) \
_(NAT_SET_TIMEOUTS, nat_set_timeouts) \