From cc9a1a0d39f22f653801f5d08bfe4892325254b5 Mon Sep 17 00:00:00 2001 From: Nathan Skrzypczak Date: Thu, 25 Feb 2021 12:06:11 +0100 Subject: 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 Signed-off-by: Nathan Skrzypczak --- src/plugins/cnat/cnat_api.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/plugins/cnat/cnat_api.c') 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 static clib_error_t * -- cgit 1.2.3-korg