diff options
author | Filip Varga <fivarga@cisco.com> | 2020-12-21 18:20:00 +0100 |
---|---|---|
committer | Ole Tr�an <otroan@employees.org> | 2021-01-11 09:26:28 +0000 |
commit | 68d7c546fa7e6c801031f2922c9be067d64e0f59 (patch) | |
tree | 91c772be339c023da07cf0ad832370340b096667 /src/plugins/nat/nat44_cli.c | |
parent | 0bc78d80363efc22d07171473933d1b0016440e4 (diff) |
nat: refactor and split fo EI/ED features p.2
Patch n. 2 aimed at moving EI features out of
NAT44 plugin & split of EI/ED functions.
Type: refactor
Change-Id: Ida20c1c084449b146344b6c3d8442f49efb6f3fa
Signed-off-by: Filip Varga <fivarga@cisco.com>
Diffstat (limited to 'src/plugins/nat/nat44_cli.c')
-rw-r--r-- | src/plugins/nat/nat44_cli.c | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/src/plugins/nat/nat44_cli.c b/src/plugins/nat/nat44_cli.c index 7415b5fe76f..adcf324850d 100644 --- a/src/plugins/nat/nat44_cli.c +++ b/src/plugins/nat/nat44_cli.c @@ -44,8 +44,6 @@ nat44_enable_command_fn (vlib_main_t * vm, nat44_config_t c = { 0 }; u8 mode_set = 0; - // TODO: check this also inside the function so it can be - // safely called from anyplace, also sanity checking required if (sm->enabled) return clib_error_return (0, "nat44 already enabled"); @@ -1148,11 +1146,10 @@ add_static_mapping_command_fn (vlib_main_t * vm, goto done; } - rv = snat_add_static_mapping (l_addr, e_addr, clib_host_to_net_u16 (l_port), - clib_host_to_net_u16 (e_port), - vrf_id, addr_only, sw_if_index, proto, is_add, - twice_nat, out2in_only, 0, 0, exact_addr, - exact); + rv = snat_add_static_mapping ( + l_addr, e_addr, clib_host_to_net_u16 (l_port), + clib_host_to_net_u16 (e_port), vrf_id, addr_only, sw_if_index, proto, + is_add, twice_nat, out2in_only, 0, 0, exact_addr, exact); switch (rv) { @@ -1230,11 +1227,9 @@ add_identity_mapping_command_fn (vlib_main_t * vm, } } - rv = - snat_add_static_mapping (addr, addr, clib_host_to_net_u16 (port), - clib_host_to_net_u16 (port), vrf_id, addr_only, - sw_if_index, proto, is_add, 0, 0, 0, 1, - pool_addr, 0); + rv = snat_add_static_mapping ( + addr, addr, clib_host_to_net_u16 (port), clib_host_to_net_u16 (port), + vrf_id, addr_only, sw_if_index, proto, is_add, 0, 0, 0, 1, pool_addr, 0); switch (rv) { @@ -1779,9 +1774,8 @@ nat44_del_session_command_fn (vlib_main_t * vm, clib_host_to_net_u16 (eh_port), nat_proto_to_ip_proto (proto), vrf_id, is_in); else - rv = - nat44_del_session (sm, &addr, clib_host_to_net_u16 (port), proto, - vrf_id, is_in); + rv = nat44_ei_del_session (sm, &addr, clib_host_to_net_u16 (port), proto, + vrf_id, is_in); switch (rv) { |