diff options
author | Filip Varga <fivarga@cisco.com> | 2020-07-21 10:27:39 +0200 |
---|---|---|
committer | Ole Trøan <otroan@employees.org> | 2020-08-13 10:06:33 +0000 |
commit | 603e75465899385a95350f3c96499050f7f960a5 (patch) | |
tree | f7a7130769ea795c1c3460db3aea99a49a309b13 /src/plugins/nat/nat_format.c | |
parent | de118da58e80aec43f4b816a1ea957634a8bc07c (diff) |
nat: move deterministic nat to det44 sub feature
Type: refactor
Change-Id: I0bb203102a0e13dd7448e2125925ab356bbd7937
Signed-off-by: Filip Varga <fivarga@cisco.com>
Diffstat (limited to 'src/plugins/nat/nat_format.c')
-rw-r--r-- | src/plugins/nat/nat_format.c | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/src/plugins/nat/nat_format.c b/src/plugins/nat/nat_format.c index 8287968e029..e47ba69b167 100644 --- a/src/plugins/nat/nat_format.c +++ b/src/plugins/nat/nat_format.c @@ -19,7 +19,6 @@ #include <nat/nat.h> #include <nat/nat_inlines.h> -#include <nat/nat_det.h> uword unformat_nat_protocol (unformat_input_t * input, va_list * args) @@ -297,39 +296,6 @@ format_snat_static_map_to_resolve (u8 * s, va_list * args) return s; } -u8 * -format_det_map_ses (u8 * s, va_list * args) -{ - snat_det_map_t *det_map = va_arg (*args, snat_det_map_t *); - ip4_address_t in_addr, out_addr; - u32 in_offset, out_offset; - snat_det_session_t *ses = va_arg (*args, snat_det_session_t *); - u32 *i = va_arg (*args, u32 *); - - u32 user_index = *i / SNAT_DET_SES_PER_USER; - in_addr.as_u32 = - clib_host_to_net_u32 (clib_net_to_host_u32 (det_map->in_addr.as_u32) + - user_index); - in_offset = - clib_net_to_host_u32 (in_addr.as_u32) - - clib_net_to_host_u32 (det_map->in_addr.as_u32); - out_offset = in_offset / det_map->sharing_ratio; - out_addr.as_u32 = - clib_host_to_net_u32 (clib_net_to_host_u32 (det_map->out_addr.as_u32) + - out_offset); - s = - format (s, - "in %U:%d out %U:%d external host %U:%d state: %U expire: %d\n", - format_ip4_address, &in_addr, clib_net_to_host_u16 (ses->in_port), - format_ip4_address, &out_addr, - clib_net_to_host_u16 (ses->out.out_port), format_ip4_address, - &ses->out.ext_host_addr, - clib_net_to_host_u16 (ses->out.ext_host_port), - format_snat_session_state, ses->state, ses->expire); - - return s; -} - /* * fd.io coding-style-patch-verification: ON * |