FD.io VPP  v21.06-3-gbb25fbf28
Vector Packet Processing
nat44_ei_hairpinning.c File Reference
+ Include dependency graph for nat44_ei_hairpinning.c:

Go to the source code of this file.

Data Structures

struct  nat44_ei_hairpin_trace_t
 

Macros

#define NAT44_EI_FLAG_HAIRPINNING   (1 << 0)
 

Enumerations

enum  nat44_ei_hairpin_src_next_t {
  NAT44_EI_HAIRPIN_SRC_NEXT_DROP, NAT44_EI_HAIRPIN_SRC_NEXT_SNAT_IN2OUT, NAT44_EI_HAIRPIN_SRC_NEXT_SNAT_IN2OUT_WH, NAT44_EI_HAIRPIN_SRC_NEXT_INTERFACE_OUTPUT,
  NAT44_EI_HAIRPIN_SRC_N_NEXT
}
 
enum  nat44_ei_hairpin_next_t { NAT44_EI_HAIRPIN_NEXT_LOOKUP, NAT44_EI_HAIRPIN_NEXT_DROP, NAT44_EI_HAIRPIN_NEXT_HANDOFF, NAT44_EI_HAIRPIN_N_NEXT }
 

Functions

static u8format_nat44_ei_hairpin_trace (u8 *s, va_list *args)
 
static_always_inline int nat44_ei_is_hairpinning (nat44_ei_main_t *nm, ip4_address_t *dst_addr)
 
void nat44_ei_hairpinning_sm_unknown_proto (nat44_ei_main_t *nm, vlib_buffer_t *b, ip4_header_t *ip)
 
int nat44_ei_hairpinning (vlib_main_t *vm, vlib_node_runtime_t *node, nat44_ei_main_t *nm, u32 thread_index, vlib_buffer_t *b0, ip4_header_t *ip0, udp_header_t *udp0, tcp_header_t *tcp0, u32 proto0, int do_trace, u32 *required_thread_index)
 
u32 nat44_ei_icmp_hairpinning (nat44_ei_main_t *nm, vlib_buffer_t *b0, u32 thread_index, ip4_header_t *ip0, icmp46_header_t *icmp0, u32 *required_thread_index)
 
void nat44_ei_hairpinning_unknown_proto (nat44_ei_main_t *nm, vlib_buffer_t *b, ip4_header_t *ip)
 
 while (n_left_from > 0)
 

Variables

vnet_feature_arc_registration_t vnet_feat_arc_ip4_local
 
vlib_main_tvm
 
vlib_main_t vlib_node_runtime_tnode
 
vlib_main_t vlib_node_runtime_t vlib_frame_tframe
 
nat44_ei_hairpin_src_next_t next_index = node->cached_next_index
 
nat44_ei_main_tnm = &nat44_ei_main
 
 from = vlib_frame_vector_args (frame)
 
 n_left_from = frame->n_vectors
 
return frame n_vectors
 
u32 thread_index = vm->thread_index
 
vnet_feature_main_tfm = &feature_main
 
u8 arc_index = vnet_feat_arc_ip4_local.feature_arc_index
 
vnet_feature_config_main_tcm = &fm->feature_config_mains[arc_index]
 
vlib_node_registration_t nat44_ei_hairpinning_dst_handoff_node
 (constructor) VLIB_REGISTER_NODE (nat44_ei_hairpinning_dst_handoff_node) More...
 
vlib_node_registration_t nat44_ei_hairpinning_handoff_node
 (constructor) VLIB_REGISTER_NODE (nat44_ei_hairpinning_handoff_node) More...
 
vlib_node_registration_t nat44_ei_hairpin_src_node
 (constructor) VLIB_REGISTER_NODE (nat44_ei_hairpin_src_node) More...
 
vlib_node_registration_t nat44_ei_hairpin_dst_node
 (constructor) VLIB_REGISTER_NODE (nat44_ei_hairpin_dst_node) More...
 
vlib_node_registration_t nat44_ei_hairpinning_node
 (constructor) VLIB_REGISTER_NODE (nat44_ei_hairpinning_node) More...
 

Macro Definition Documentation

◆ NAT44_EI_FLAG_HAIRPINNING

#define NAT44_EI_FLAG_HAIRPINNING   (1 << 0)

Definition at line 26 of file nat44_ei_hairpinning.c.

Enumeration Type Documentation

◆ nat44_ei_hairpin_next_t

Enumerator
NAT44_EI_HAIRPIN_NEXT_LOOKUP 
NAT44_EI_HAIRPIN_NEXT_DROP 
NAT44_EI_HAIRPIN_NEXT_HANDOFF 
NAT44_EI_HAIRPIN_N_NEXT 

Definition at line 37 of file nat44_ei_hairpinning.c.

◆ nat44_ei_hairpin_src_next_t

Enumerator
NAT44_EI_HAIRPIN_SRC_NEXT_DROP 
NAT44_EI_HAIRPIN_SRC_NEXT_SNAT_IN2OUT 
NAT44_EI_HAIRPIN_SRC_NEXT_SNAT_IN2OUT_WH 
NAT44_EI_HAIRPIN_SRC_NEXT_INTERFACE_OUTPUT 
NAT44_EI_HAIRPIN_SRC_N_NEXT 

Definition at line 28 of file nat44_ei_hairpinning.c.

Function Documentation

◆ format_nat44_ei_hairpin_trace()

static u8* format_nat44_ei_hairpin_trace ( u8 s,
va_list *  args 
)
static

Definition at line 54 of file nat44_ei_hairpinning.c.

◆ nat44_ei_hairpinning()

int nat44_ei_hairpinning ( vlib_main_t vm,
vlib_node_runtime_t node,
nat44_ei_main_t nm,
u32  thread_index,
vlib_buffer_t b0,
ip4_header_t ip0,
udp_header_t udp0,
tcp_header_t tcp0,
u32  proto0,
int  do_trace,
u32 required_thread_index 
)

Definition at line 124 of file nat44_ei_hairpinning.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ nat44_ei_hairpinning_sm_unknown_proto()

void nat44_ei_hairpinning_sm_unknown_proto ( nat44_ei_main_t nm,
vlib_buffer_t b,
ip4_header_t ip 
)

Definition at line 97 of file nat44_ei_hairpinning.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ nat44_ei_hairpinning_unknown_proto()

void nat44_ei_hairpinning_unknown_proto ( nat44_ei_main_t nm,
vlib_buffer_t b,
ip4_header_t ip 
)

Definition at line 383 of file nat44_ei_hairpinning.c.

+ Here is the call graph for this function:

◆ nat44_ei_icmp_hairpinning()

u32 nat44_ei_icmp_hairpinning ( nat44_ei_main_t nm,
vlib_buffer_t b0,
u32  thread_index,
ip4_header_t ip0,
icmp46_header_t *  icmp0,
u32 required_thread_index 
)

Definition at line 251 of file nat44_ei_hairpinning.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ nat44_ei_is_hairpinning()

static_always_inline int nat44_ei_is_hairpinning ( nat44_ei_main_t nm,
ip4_address_t dst_addr 
)

Definition at line 77 of file nat44_ei_hairpinning.c.

+ Here is the call graph for this function:

◆ while()

while ( n_left_from  ,
 
)

Definition at line 419 of file nat44_ei_hairpinning.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ arc_index

u8 arc_index = vnet_feat_arc_ip4_local.feature_arc_index

Definition at line 590 of file nat44_ei_hairpinning.c.

◆ cm

vnet_feature_config_main_t* cm = &fm->feature_config_mains[arc_index]

Definition at line 591 of file nat44_ei_hairpinning.c.

◆ fm

Definition at line 589 of file nat44_ei_hairpinning.c.

◆ frame

Initial value:
{
u32 n_left_from, *from, *to_next

Definition at line 410 of file nat44_ei_hairpinning.c.

◆ from

Definition at line 415 of file nat44_ei_hairpinning.c.

◆ n_left_from

n_left_from = frame->n_vectors

Definition at line 416 of file nat44_ei_hairpinning.c.

◆ n_vectors

return frame n_vectors

Definition at line 485 of file nat44_ei_hairpinning.c.

◆ nat44_ei_hairpin_dst_node

vlib_node_registration_t nat44_ei_hairpin_dst_node
Initial value:
= {
.name = "nat44-ei-hairpin-dst",
.vector_size = sizeof (u32),
.n_next_nodes = NAT44_EI_HAIRPIN_N_NEXT,
.next_nodes = {
[NAT44_EI_HAIRPIN_NEXT_DROP] = "error-drop",
[NAT44_EI_HAIRPIN_NEXT_LOOKUP] = "ip4-lookup",
[NAT44_EI_HAIRPIN_NEXT_HANDOFF] = "nat44-ei-hairpin-dst-handoff",
},
}

(constructor) VLIB_REGISTER_NODE (nat44_ei_hairpin_dst_node)

Definition at line 724 of file nat44_ei_hairpinning.c.

◆ nat44_ei_hairpin_src_node

vlib_node_registration_t nat44_ei_hairpin_src_node
Initial value:
= {
.name = "nat44-ei-hairpin-src",
.vector_size = sizeof (u32),
.n_next_nodes = NAT44_EI_HAIRPIN_SRC_N_NEXT,
.next_nodes = {
[NAT44_EI_HAIRPIN_SRC_NEXT_SNAT_IN2OUT] = "nat44-ei-in2out-output",
[NAT44_EI_HAIRPIN_SRC_NEXT_SNAT_IN2OUT_WH] = "nat44-ei-in2out-output-worker-handoff",
},
}

(constructor) VLIB_REGISTER_NODE (nat44_ei_hairpin_src_node)

Definition at line 711 of file nat44_ei_hairpinning.c.

◆ nat44_ei_hairpinning_dst_handoff_node

vlib_node_registration_t nat44_ei_hairpinning_dst_handoff_node
Initial value:
= {
.name = "nat44-ei-hairpin-dst-handoff",
.vector_size = sizeof (u32),
.n_next_nodes = 1,
.next_nodes = {
[0] = "error-drop",
},
}

(constructor) VLIB_REGISTER_NODE (nat44_ei_hairpinning_dst_handoff_node)

Definition at line 683 of file nat44_ei_hairpinning.c.

◆ nat44_ei_hairpinning_handoff_node

vlib_node_registration_t nat44_ei_hairpinning_handoff_node
Initial value:
= {
.name = "nat44-ei-hairpinning-handoff",
.vector_size = sizeof (u32),
.n_next_nodes = 1,
.next_nodes = {
[0] = "error-drop",
},
}

(constructor) VLIB_REGISTER_NODE (nat44_ei_hairpinning_handoff_node)

Definition at line 697 of file nat44_ei_hairpinning.c.

◆ nat44_ei_hairpinning_node

vlib_node_registration_t nat44_ei_hairpinning_node
Initial value:
= {
.name = "nat44-ei-hairpinning",
.vector_size = sizeof (u32),
.n_next_nodes = NAT44_EI_HAIRPIN_N_NEXT,
.next_nodes = {
[NAT44_EI_HAIRPIN_NEXT_DROP] = "error-drop",
[NAT44_EI_HAIRPIN_NEXT_LOOKUP] = "ip4-lookup",
[NAT44_EI_HAIRPIN_NEXT_HANDOFF] = "nat44-ei-hairpinning-handoff",
},
}

(constructor) VLIB_REGISTER_NODE (nat44_ei_hairpinning_node)

Definition at line 737 of file nat44_ei_hairpinning.c.

◆ next_index

lcp_arp_next_t next_index = node->cached_next_index

Definition at line 412 of file nat44_ei_hairpinning.c.

◆ nm

Definition at line 413 of file nat44_ei_hairpinning.c.

◆ node

Definition at line 409 of file nat44_ei_hairpinning.c.

◆ thread_index

u32 thread_index = vm->thread_index

Definition at line 492 of file nat44_ei_hairpinning.c.

◆ vm

Definition at line 409 of file nat44_ei_hairpinning.c.

◆ vnet_feat_arc_ip4_local

vnet_feature_arc_registration_t vnet_feat_arc_ip4_local
nat44_ei_hairpinning_handoff_error_strings
static char * nat44_ei_hairpinning_handoff_error_strings[]
Definition: nat44_ei_hairpinning.h:17
VLIB_NODE_TYPE_INTERNAL
@ VLIB_NODE_TYPE_INTERNAL
Definition: node.h:72
NAT44_EI_HAIRPIN_NEXT_DROP
@ NAT44_EI_HAIRPIN_NEXT_DROP
Definition: nat44_ei_hairpinning.c:40
NAT44_EI_HAIRPIN_SRC_NEXT_DROP
@ NAT44_EI_HAIRPIN_SRC_NEXT_DROP
Definition: nat44_ei_hairpinning.c:30
NAT44_EI_HAIRPIN_SRC_NEXT_SNAT_IN2OUT
@ NAT44_EI_HAIRPIN_SRC_NEXT_SNAT_IN2OUT
Definition: nat44_ei_hairpinning.c:31
NAT44_EI_HAIRPIN_SRC_NEXT_SNAT_IN2OUT_WH
@ NAT44_EI_HAIRPIN_SRC_NEXT_SNAT_IN2OUT_WH
Definition: nat44_ei_hairpinning.c:32
NAT44_EI_HAIRPIN_N_NEXT
@ NAT44_EI_HAIRPIN_N_NEXT
Definition: nat44_ei_hairpinning.c:42
ARRAY_LEN
#define ARRAY_LEN(x)
Definition: clib.h:70
format_nat44_ei_hairpinning_handoff_trace
static u8 * format_nat44_ei_hairpinning_handoff_trace(u8 *s, va_list *args)
Definition: nat44_ei_hairpinning.h:29
NAT44_EI_HAIRPIN_NEXT_LOOKUP
@ NAT44_EI_HAIRPIN_NEXT_LOOKUP
Definition: nat44_ei_hairpinning.c:39
NAT44_EI_HAIRPIN_SRC_NEXT_INTERFACE_OUTPUT
@ NAT44_EI_HAIRPIN_SRC_NEXT_INTERFACE_OUTPUT
Definition: nat44_ei_hairpinning.c:33
u32
unsigned int u32
Definition: types.h:88
NAT44_EI_HAIRPIN_SRC_N_NEXT
@ NAT44_EI_HAIRPIN_SRC_N_NEXT
Definition: nat44_ei_hairpinning.c:34
from
from
Definition: nat44_ei_hairpinning.c:415
NAT44_EI_HAIRPIN_NEXT_HANDOFF
@ NAT44_EI_HAIRPIN_NEXT_HANDOFF
Definition: nat44_ei_hairpinning.c:41
n_left_from
n_left_from
Definition: nat44_ei_hairpinning.c:416
type
vl_api_fib_path_type_t type
Definition: fib_types.api:123
format_nat44_ei_hairpin_trace
static u8 * format_nat44_ei_hairpin_trace(u8 *s, va_list *args)
Definition: nat44_ei_hairpinning.c:54