/* CNat sub for source NAT as a feature arc on ip[46]-unicast
This node's sub shouldn't apply to the same flows as
cnat_vip_inline */
-always_inline uword
-cnat_snat_inline (vlib_main_t * vm,
- vlib_node_runtime_t * node,
- vlib_buffer_t * b,
- cnat_node_ctx_t * ctx, int rv, cnat_session_t * session)
+static uword
+cnat_snat_node_fn (vlib_main_t * vm,
+ vlib_node_runtime_t * node,
+ vlib_buffer_t * b,
+ cnat_node_ctx_t * ctx, int rv, cnat_session_t * session)
{
cnat_main_t *cm = &cnat_main;
int created_session = 0;
- ip4_header_t *ip4;
+ ip4_header_t *ip4 = NULL;
ip_protocol_t iproto;
- ip6_header_t *ip6;
+ ip6_header_t *ip6 = NULL;
udp_header_t *udp0;
u32 arc_next0;
u16 next0;
vlib_frame_t * frame)
{
if (PREDICT_FALSE ((node->flags & VLIB_NODE_FLAG_TRACE)))
- return cnat_node_inline (vm, node, frame, cnat_snat_inline, AF_IP4,
+ return cnat_node_inline (vm, node, frame, cnat_snat_node_fn, AF_IP4,
1 /* do_trace */ );
- return cnat_node_inline (vm, node, frame, cnat_snat_inline, AF_IP4,
+ return cnat_node_inline (vm, node, frame, cnat_snat_node_fn, AF_IP4,
0 /* do_trace */ );
}
vlib_frame_t * frame)
{
if (PREDICT_FALSE ((node->flags & VLIB_NODE_FLAG_TRACE)))
- return cnat_node_inline (vm, node, frame, cnat_snat_inline, AF_IP6,
+ return cnat_node_inline (vm, node, frame, cnat_snat_node_fn, AF_IP6,
1 /* do_trace */ );
- return cnat_node_inline (vm, node, frame, cnat_snat_inline, AF_IP6,
+ return cnat_node_inline (vm, node, frame, cnat_snat_node_fn, AF_IP6,
0 /* do_trace */ );
}
}
/* CNat sub for NAT behind a fib entry (VIP or interposed real IP) */
-always_inline uword
-cnat_vip_inline (vlib_main_t * vm,
- vlib_node_runtime_t * node,
- vlib_buffer_t * b,
- cnat_node_ctx_t * ctx, int rv, cnat_session_t * session)
+static uword
+cnat_vip_node_fn (vlib_main_t * vm,
+ vlib_node_runtime_t * node,
+ vlib_buffer_t * b,
+ cnat_node_ctx_t * ctx, int rv, cnat_session_t * session)
{
vlib_combined_counter_main_t *cntm = &cnat_translation_counters;
const cnat_translation_t *ct = NULL;
vlib_frame_t * frame)
{
if (PREDICT_FALSE ((node->flags & VLIB_NODE_FLAG_TRACE)))
- return cnat_node_inline (vm, node, frame, cnat_vip_inline, AF_IP4,
+ return cnat_node_inline (vm, node, frame, cnat_vip_node_fn, AF_IP4,
1 /* do_trace */ );
- return cnat_node_inline (vm, node, frame, cnat_vip_inline, AF_IP4,
+ return cnat_node_inline (vm, node, frame, cnat_vip_node_fn, AF_IP4,
0 /* do_trace */ );
}
vlib_frame_t * frame)
{
if (PREDICT_FALSE ((node->flags & VLIB_NODE_FLAG_TRACE)))
- return cnat_node_inline (vm, node, frame, cnat_vip_inline, AF_IP6,
+ return cnat_node_inline (vm, node, frame, cnat_vip_node_fn, AF_IP6,
1 /* do_trace */ );
- return cnat_node_inline (vm, node, frame, cnat_vip_inline, AF_IP6,
+ return cnat_node_inline (vm, node, frame, cnat_vip_node_fn, AF_IP6,
0 /* do_trace */ );
}