From 5b88feeb7f81905df0cffc5d7cb372c98cfa949e Mon Sep 17 00:00:00 2001 From: Jon Loeliger Date: Wed, 17 Aug 2022 12:08:31 -0500 Subject: nat: simplify per-protocol code by using an array rather than using obfuscated macro hacery, simplify the per-protocol data management by directly using an array of NAT protocol types. Type: refactor Signed-off-by: Jon Loeliger Change-Id: I6fe987556ac9f402f8d490da0740e2b91440304c --- src/plugins/nat/nat44-ei/nat44_ei.h | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'src/plugins/nat/nat44-ei/nat44_ei.h') diff --git a/src/plugins/nat/nat44-ei/nat44_ei.h b/src/plugins/nat/nat44-ei/nat44_ei.h index c79cbfe5d57..b4aa0f26c0b 100644 --- a/src/plugins/nat/nat44-ei/nat44_ei.h +++ b/src/plugins/nat/nat44-ei/nat44_ei.h @@ -71,12 +71,9 @@ typedef struct { ip4_address_t addr; u32 fib_index; -#define _(N, i, n, s) \ - u32 busy_##n##_ports; \ - u32 *busy_##n##_ports_per_thread; \ - uword *busy_##n##_port_bitmap; - foreach_nat_protocol -#undef _ + u32 busy_ports[NAT_N_PROTOCOLS]; + u32 *busy_ports_per_thread[NAT_N_PROTOCOLS]; + uword *busy_port_bitmap[NAT_N_PROTOCOLS]; } nat44_ei_address_t; clib_error_t *nat44_ei_api_hookup (vlib_main_t *vm); -- cgit 1.2.3-korg