From 1f36023d29137825b8a09578d09b955046c2415b Mon Sep 17 00:00:00 2001 From: Filip Varga Date: Mon, 14 Sep 2020 11:20:16 +0200 Subject: nat: move nat64 to a subfeature Type: refactor Change-Id: I3b9e17164647d2019b1f40cffeed63393345219e Signed-off-by: Filip Varga --- src/plugins/nat/nat44_cli.c | 47 +++++---------------------------------------- 1 file changed, 5 insertions(+), 42 deletions(-) (limited to 'src/plugins/nat/nat44_cli.c') diff --git a/src/plugins/nat/nat44_cli.c b/src/plugins/nat/nat44_cli.c index f61ce2c2ab7..ef11f519fa1 100644 --- a/src/plugins/nat/nat44_cli.c +++ b/src/plugins/nat/nat44_cli.c @@ -19,7 +19,7 @@ #include #include -#include +#include #include #include #include @@ -1774,55 +1774,18 @@ set_timeout_command_fn (vlib_main_t * vm, while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT) { - if (unformat (line_input, "udp %u", &sm->udp_timeout)) - { - if (nat64_set_udp_timeout (sm->udp_timeout)) - { - error = clib_error_return (0, "Invalid UDP timeout value"); - goto done; - } - } + if (unformat (line_input, "udp %u", &sm->udp_timeout)); else if (unformat (line_input, "tcp-established %u", - &sm->tcp_established_timeout)) - { - if (nat64_set_tcp_timeouts - (sm->tcp_transitory_timeout, sm->tcp_established_timeout)) - { - error = - clib_error_return (0, - "Invalid TCP established timeouts value"); - goto done; - } - } + &sm->tcp_established_timeout)); else if (unformat (line_input, "tcp-transitory %u", - &sm->tcp_transitory_timeout)) - { - if (nat64_set_tcp_timeouts - (sm->tcp_transitory_timeout, sm->tcp_established_timeout)) - { - error = - clib_error_return (0, - "Invalid TCP transitory timeouts value"); - goto done; - } - } - else if (unformat (line_input, "icmp %u", &sm->icmp_timeout)) - { - if (nat64_set_icmp_timeout (sm->icmp_timeout)) - { - error = clib_error_return (0, "Invalid ICMP timeout value"); - goto done; - } - } + &sm->tcp_transitory_timeout)); + else if (unformat (line_input, "icmp %u", &sm->icmp_timeout)); else if (unformat (line_input, "reset")) { sm->udp_timeout = SNAT_UDP_TIMEOUT; sm->tcp_established_timeout = SNAT_TCP_ESTABLISHED_TIMEOUT; sm->tcp_transitory_timeout = SNAT_TCP_TRANSITORY_TIMEOUT; sm->icmp_timeout = SNAT_ICMP_TIMEOUT; - nat64_set_udp_timeout (0); - nat64_set_icmp_timeout (0); - nat64_set_tcp_timeouts (0, 0); } else { -- cgit 1.2.3-korg