From 070387d3f4b0b5a5742b95fca19404cb50fa9927 Mon Sep 17 00:00:00 2001 From: Klement Sekera Date: Tue, 2 Feb 2021 20:15:59 +0100 Subject: nat: improve type safety and remove unused param Type: improvement Change-Id: I456f9b14e6a4eb46c9c49f6e09acccae530e4ebc Signed-off-by: Klement Sekera --- src/plugins/nat/nat.h | 70 ++++++++++++++++++--------------------------------- 1 file changed, 25 insertions(+), 45 deletions(-) (limited to 'src/plugins/nat/nat.h') diff --git a/src/plugins/nat/nat.h b/src/plugins/nat/nat.h index d7f60dd2145..e913484887a 100644 --- a/src/plugins/nat/nat.h +++ b/src/plugins/nat/nat.h @@ -525,17 +525,11 @@ typedef struct struct snat_main_s; /* ICMP session match function */ -typedef u32 (snat_icmp_match_function_t) (struct snat_main_s * sm, - vlib_node_runtime_t * node, - u32 thread_index, - vlib_buffer_t * b0, - ip4_header_t * ip0, - ip4_address_t * addr, - u16 * port, - u32 * fib_index, - nat_protocol_t * proto, - void *d, void *e, - u8 * dont_translate); +typedef u32 (snat_icmp_match_function_t) ( + struct snat_main_s *sm, vlib_node_runtime_t *node, u32 thread_index, + vlib_buffer_t *b0, ip4_header_t *ip0, ip4_address_t *addr, u16 *port, + u32 *fib_index, nat_protocol_t *proto, snat_session_t **s_out, + u8 *dont_translate); /* Return worker thread index for given packet */ typedef u32 (snat_get_worker_in2out_function_t) (ip4_header_t * ip, @@ -1132,40 +1126,26 @@ do \ nat_elog_X1(SNAT_LOG_INFO, "[info] " nat_elog_fmt_str, nat_elog_fmt_arg, nat_elog_val1) /* ICMP session match functions */ -u32 icmp_match_in2out_fast (snat_main_t * sm, vlib_node_runtime_t * node, - u32 thread_index, vlib_buffer_t * b0, - ip4_header_t * ip0, ip4_address_t * addr, - u16 * port, u32 * fib_index, - nat_protocol_t * proto, void *d, void *e, - u8 * dont_translate); -u32 icmp_match_in2out_slow (snat_main_t * sm, vlib_node_runtime_t * node, - u32 thread_index, vlib_buffer_t * b0, - ip4_header_t * ip0, ip4_address_t * addr, - u16 * port, u32 * fib_index, - nat_protocol_t * proto, void *d, void *e, - u8 * dont_translate); -u32 icmp_match_out2in_fast (snat_main_t * sm, vlib_node_runtime_t * node, - u32 thread_index, vlib_buffer_t * b0, - ip4_header_t * ip0, ip4_address_t * addr, - u16 * port, u32 * fib_index, - nat_protocol_t * proto, void *d, void *e, - u8 * dont_translate); -u32 icmp_match_out2in_slow (snat_main_t * sm, vlib_node_runtime_t * node, - u32 thread_index, vlib_buffer_t * b0, - ip4_header_t * ip0, ip4_address_t * addr, - u16 * port, u32 * fib_index, - nat_protocol_t * proto, void *d, void *e, - u8 * dont_translate); - -u32 icmp_in2out (snat_main_t * sm, vlib_buffer_t * b0, ip4_header_t * ip0, - icmp46_header_t * icmp0, u32 sw_if_index0, u32 rx_fib_index0, - vlib_node_runtime_t * node, u32 next0, u32 thread_index, - void *d, void *e); - -u32 icmp_out2in (snat_main_t * sm, vlib_buffer_t * b0, ip4_header_t * ip0, - icmp46_header_t * icmp0, u32 sw_if_index0, u32 rx_fib_index0, - vlib_node_runtime_t * node, u32 next0, u32 thread_index, - void *d, void *e); +u32 icmp_match_in2out_fast (snat_main_t *sm, vlib_node_runtime_t *node, + u32 thread_index, vlib_buffer_t *b0, + ip4_header_t *ip0, ip4_address_t *addr, u16 *port, + u32 *fib_index, nat_protocol_t *proto, + snat_session_t **s0, u8 *dont_translate); +u32 icmp_match_in2out_slow (snat_main_t *sm, vlib_node_runtime_t *node, + u32 thread_index, vlib_buffer_t *b0, + ip4_header_t *ip0, ip4_address_t *addr, u16 *port, + u32 *fib_index, nat_protocol_t *proto, + snat_session_t **s0, u8 *dont_translate); +u32 icmp_match_out2in_fast (snat_main_t *sm, vlib_node_runtime_t *node, + u32 thread_index, vlib_buffer_t *b0, + ip4_header_t *ip0, ip4_address_t *addr, u16 *port, + u32 *fib_index, nat_protocol_t *proto, + snat_session_t **s0, u8 *dont_translate); +u32 icmp_match_out2in_slow (snat_main_t *sm, vlib_node_runtime_t *node, + u32 thread_index, vlib_buffer_t *b0, + ip4_header_t *ip0, ip4_address_t *addr, u16 *port, + u32 *fib_index, nat_protocol_t *proto, + snat_session_t **s0, u8 *dont_translate); /* hairpinning functions */ u32 snat_icmp_hairpinning (snat_main_t *sm, vlib_buffer_t *b0, -- cgit 1.2.3-korg