summaryrefslogtreecommitdiffstats
path: root/src/plugins/cnat/cnat_api.c
diff options
context:
space:
mode:
authorNathan Skrzypczak <nathan.skrzypczak@gmail.com>2021-02-25 12:06:11 +0100
committerFlorin Coras <florin.coras@gmail.com>2021-02-26 01:55:07 +0000
commitcc9a1a0d39f22f653801f5d08bfe4892325254b5 (patch)
treec19e3ebea400c7cba3009d8e31097e2c40dfad88 /src/plugins/cnat/cnat_api.c
parent4d237874e5c9922330c62ac1b003a9a171c1bc3b (diff)
cnat: add input feature node
This allows to configure nat on a per-interface basis. Special care must be taken to ensure the configuration remains consistent. Type: feature Change-Id: I352b2dce182e09d30813ce958333bb1ff37d9b4e Signed-off-by: Aloys Augustin <aloaugus@cisco.com> Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
Diffstat (limited to 'src/plugins/cnat/cnat_api.c')
-rw-r--r--src/plugins/cnat/cnat_api.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/plugins/cnat/cnat_api.c b/src/plugins/cnat/cnat_api.c
index 99d9c729282..652e5c09d1a 100644
--- a/src/plugins/cnat/cnat_api.c
+++ b/src/plugins/cnat/cnat_api.c
@@ -337,6 +337,23 @@ static void
REPLY_MACRO (VL_API_CNAT_ADD_DEL_SNAT_PREFIX_REPLY);
}
+static void
+vl_api_cnat_set_snat_policy_t_handler (vl_api_cnat_set_snat_policy_t *mp)
+{
+ vl_api_cnat_set_snat_policy_reply_t *rmp;
+ int rv = 0;
+ vl_api_cnat_snat_policies_t policy = clib_net_to_host_u32 (mp->policy);
+ switch (policy)
+ {
+ case CNAT_SNAT_POLICY_NONE:
+ cnat_set_snat_policy (NULL);
+ break;
+ default:
+ rv = 1;
+ }
+
+ REPLY_MACRO (VL_API_CNAT_SET_SNAT_POLICY_REPLY);
+}
#include <cnat/cnat.api.c>
static clib_error_t *