summaryrefslogtreecommitdiffstats
path: root/src/plugins/nat/nat.h
diff options
context:
space:
mode:
authorKlement Sekera <ksekera@cisco.com>2021-02-02 20:15:59 +0100
committerOle Tr�an <otroan@employees.org>2021-02-09 09:55:09 +0000
commit070387d3f4b0b5a5742b95fca19404cb50fa9927 (patch)
tree89832d74c698377a33319dbb2985d9cb81dc8e85 /src/plugins/nat/nat.h
parent751bb131ef504b64fe82f393df21dba95ca92e97 (diff)
nat: improve type safety and remove unused param
Type: improvement Change-Id: I456f9b14e6a4eb46c9c49f6e09acccae530e4ebc Signed-off-by: Klement Sekera <ksekera@cisco.com>
Diffstat (limited to 'src/plugins/nat/nat.h')
-rw-r--r--src/plugins/nat/nat.h70
1 files changed, 25 insertions, 45 deletions
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,