FD.io VPP  v20.01-48-g3e0dafb74
Vector Packet Processing
nat44_hairpinning.c File Reference

NAT44 hairpinning. More...

+ Include dependency graph for nat44_hairpinning.c:

Go to the source code of this file.

Macros

#define foreach_nat44_hairpin_error   _(PROCESSED, "NAT44 hairpinning packets processed")
 

Enumerations

enum  snat_hairpin_src_next_t {
  SNAT_HAIRPIN_SRC_NEXT_DROP, SNAT_HAIRPIN_SRC_NEXT_SNAT_IN2OUT, SNAT_HAIRPIN_SRC_NEXT_SNAT_IN2OUT_WH, SNAT_HAIRPIN_SRC_NEXT_INTERFACE_OUTPUT,
  SNAT_HAIRPIN_SRC_N_NEXT
}
 
enum  nat_hairpin_next_t { NAT_HAIRPIN_NEXT_LOOKUP, NAT_HAIRPIN_NEXT_DROP, NAT_HAIRPIN_N_NEXT }
 
enum  nat44_hairpin_error_t { NAT44_HAIRPIN_N_ERROR }
 

Functions

static_always_inline int is_hairpinning (snat_main_t *sm, ip4_address_t *dst_addr)
 
int snat_hairpinning (snat_main_t *sm, vlib_buffer_t *b0, ip4_header_t *ip0, udp_header_t *udp0, tcp_header_t *tcp0, u32 proto0, int is_ed)
 
u32 snat_icmp_hairpinning (snat_main_t *sm, vlib_buffer_t *b0, ip4_header_t *ip0, icmp46_header_t *icmp0, int is_ed)
 
void nat_hairpinning_sm_unknown_proto (snat_main_t *sm, vlib_buffer_t *b, ip4_header_t *ip)
 
void nat44_ed_hairpinning_unknown_proto (snat_main_t *sm, vlib_buffer_t *b, ip4_header_t *ip)
 
void nat44_reass_hairpinning (snat_main_t *sm, vlib_buffer_t *b0, ip4_header_t *ip0, u16 sport, u16 dport, u32 proto0, int is_ed)
 
static uword nat44_hairpinning_fn_inline (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, int is_ed)
 
VLIB_NODE_FN() nat44_hairpinning_node (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 
VLIB_NODE_FN() nat44_ed_hairpinning_node (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 
static uword snat_hairpin_dst_fn_inline (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, int is_ed)
 
VLIB_NODE_FN() snat_hairpin_dst_node (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 
VLIB_NODE_FN() nat44_ed_hairpin_dst_node (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 
static uword snat_hairpin_src_fn_inline (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, int is_ed)
 
VLIB_NODE_FN() snat_hairpin_src_node (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 
VLIB_NODE_FN() nat44_ed_hairpin_src_node (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 

Variables

static char * nat44_hairpin_error_strings []
 
vnet_feature_arc_registration_t vnet_feat_arc_ip4_local
 
vlib_node_registration_t nat44_hairpinning_node
 (constructor) VLIB_REGISTER_NODE (nat44_hairpinning_node) More...
 
vlib_node_registration_t nat44_ed_hairpinning_node
 (constructor) VLIB_REGISTER_NODE (nat44_ed_hairpinning_node) More...
 
vlib_node_registration_t snat_hairpin_dst_node
 (constructor) VLIB_REGISTER_NODE (snat_hairpin_dst_node) More...
 
vlib_node_registration_t nat44_ed_hairpin_dst_node
 (constructor) VLIB_REGISTER_NODE (nat44_ed_hairpin_dst_node) More...
 
vlib_node_registration_t snat_hairpin_src_node
 (constructor) VLIB_REGISTER_NODE (snat_hairpin_src_node) More...
 
vlib_node_registration_t nat44_ed_hairpin_src_node
 (constructor) VLIB_REGISTER_NODE (nat44_ed_hairpin_src_node) More...
 

Detailed Description

NAT44 hairpinning.

Definition in file nat44_hairpinning.c.

Macro Definition Documentation

◆ foreach_nat44_hairpin_error

#define foreach_nat44_hairpin_error   _(PROCESSED, "NAT44 hairpinning packets processed")

Definition at line 42 of file nat44_hairpinning.c.

Enumeration Type Documentation

◆ nat44_hairpin_error_t

Enumerator
NAT44_HAIRPIN_N_ERROR 

Definition at line 45 of file nat44_hairpinning.c.

◆ nat_hairpin_next_t

Enumerator
NAT_HAIRPIN_NEXT_LOOKUP 
NAT_HAIRPIN_NEXT_DROP 
NAT_HAIRPIN_N_NEXT 

Definition at line 35 of file nat44_hairpinning.c.

◆ snat_hairpin_src_next_t

Enumerator
SNAT_HAIRPIN_SRC_NEXT_DROP 
SNAT_HAIRPIN_SRC_NEXT_SNAT_IN2OUT 
SNAT_HAIRPIN_SRC_NEXT_SNAT_IN2OUT_WH 
SNAT_HAIRPIN_SRC_NEXT_INTERFACE_OUTPUT 
SNAT_HAIRPIN_SRC_N_NEXT 

Definition at line 26 of file nat44_hairpinning.c.

Function Documentation

◆ is_hairpinning()

static_always_inline int is_hairpinning ( snat_main_t sm,
ip4_address_t dst_addr 
)

Definition at line 62 of file nat44_hairpinning.c.

+ Here is the caller graph for this function:

◆ nat44_ed_hairpin_dst_node()

VLIB_NODE_FN() nat44_ed_hairpin_dst_node ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t frame 
)

Definition at line 766 of file nat44_hairpinning.c.

+ Here is the call graph for this function:

◆ nat44_ed_hairpin_src_node()

VLIB_NODE_FN() nat44_ed_hairpin_src_node ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t frame 
)

Definition at line 890 of file nat44_hairpinning.c.

+ Here is the call graph for this function:

◆ nat44_ed_hairpinning_node()

VLIB_NODE_FN() nat44_ed_hairpinning_node ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t frame 
)

Definition at line 634 of file nat44_hairpinning.c.

+ Here is the call graph for this function:

◆ nat44_ed_hairpinning_unknown_proto()

void nat44_ed_hairpinning_unknown_proto ( snat_main_t sm,
vlib_buffer_t b,
ip4_header_t ip 
)

Definition at line 382 of file nat44_hairpinning.c.

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

◆ nat44_hairpinning_fn_inline()

static uword nat44_hairpinning_fn_inline ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t frame,
int  is_ed 
)
inlinestatic

Definition at line 541 of file nat44_hairpinning.c.

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

◆ nat44_hairpinning_node()

VLIB_NODE_FN() nat44_hairpinning_node ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t frame 
)

Definition at line 612 of file nat44_hairpinning.c.

+ Here is the call graph for this function:

◆ nat44_reass_hairpinning()

void nat44_reass_hairpinning ( snat_main_t sm,
vlib_buffer_t b0,
ip4_header_t ip0,
u16  sport,
u16  dport,
u32  proto0,
int  is_ed 
)

Definition at line 429 of file nat44_hairpinning.c.

+ Here is the call graph for this function:

◆ nat_hairpinning_sm_unknown_proto()

void nat_hairpinning_sm_unknown_proto ( snat_main_t sm,
vlib_buffer_t b,
ip4_header_t ip 
)

Definition at line 355 of file nat44_hairpinning.c.

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

◆ snat_hairpin_dst_fn_inline()

static uword snat_hairpin_dst_fn_inline ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t frame,
int  is_ed 
)
inlinestatic

Definition at line 657 of file nat44_hairpinning.c.

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

◆ snat_hairpin_dst_node()

VLIB_NODE_FN() snat_hairpin_dst_node ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t frame 
)

Definition at line 744 of file nat44_hairpinning.c.

+ Here is the call graph for this function:

◆ snat_hairpin_src_fn_inline()

static uword snat_hairpin_src_fn_inline ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t frame,
int  is_ed 
)
inlinestatic

Definition at line 789 of file nat44_hairpinning.c.

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

◆ snat_hairpin_src_node()

VLIB_NODE_FN() snat_hairpin_src_node ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t frame 
)

Definition at line 866 of file nat44_hairpinning.c.

+ Here is the call graph for this function:

◆ snat_hairpinning()

int snat_hairpinning ( snat_main_t sm,
vlib_buffer_t b0,
ip4_header_t ip0,
udp_header_t udp0,
tcp_header_t tcp0,
u32  proto0,
int  is_ed 
)

Definition at line 89 of file nat44_hairpinning.c.

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

◆ snat_icmp_hairpinning()

u32 snat_icmp_hairpinning ( snat_main_t sm,
vlib_buffer_t b0,
ip4_header_t ip0,
icmp46_header_t *  icmp0,
int  is_ed 
)

Definition at line 198 of file nat44_hairpinning.c.

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

Variable Documentation

◆ nat44_ed_hairpin_dst_node

vlib_node_registration_t nat44_ed_hairpin_dst_node
Initial value:
= {
.name = "nat44-ed-hairpin-dst",
.vector_size = sizeof (u32),
.error_strings = nat44_hairpin_error_strings,
.n_next_nodes = NAT_HAIRPIN_N_NEXT,
.next_nodes = {
[NAT_HAIRPIN_NEXT_DROP] = "error-drop",
[NAT_HAIRPIN_NEXT_LOOKUP] = "ip4-lookup",
},
}
static char * nat44_hairpin_error_strings[]
unsigned int u32
Definition: types.h:88
vl_api_fib_path_type_t type
Definition: fib_types.api:123
#define ARRAY_LEN(x)
Definition: clib.h:62

(constructor) VLIB_REGISTER_NODE (nat44_ed_hairpin_dst_node)

Definition at line 774 of file nat44_hairpinning.c.

◆ nat44_ed_hairpin_src_node

vlib_node_registration_t nat44_ed_hairpin_src_node
Initial value:
= {
.name = "nat44-ed-hairpin-src",
.vector_size = sizeof (u32),
.error_strings = nat44_hairpin_error_strings,
.n_next_nodes = SNAT_HAIRPIN_SRC_N_NEXT,
.next_nodes = {
[SNAT_HAIRPIN_SRC_NEXT_DROP] = "error-drop",
[SNAT_HAIRPIN_SRC_NEXT_SNAT_IN2OUT] = "nat44-ed-in2out-output",
[SNAT_HAIRPIN_SRC_NEXT_SNAT_IN2OUT_WH] = "nat44-in2out-output-worker-handoff",
},
}
static char * nat44_hairpin_error_strings[]
unsigned int u32
Definition: types.h:88
vl_api_fib_path_type_t type
Definition: fib_types.api:123
#define ARRAY_LEN(x)
Definition: clib.h:62

(constructor) VLIB_REGISTER_NODE (nat44_ed_hairpin_src_node)

Definition at line 898 of file nat44_hairpinning.c.

◆ nat44_ed_hairpinning_node

vlib_node_registration_t nat44_ed_hairpinning_node
Initial value:
= {
.name = "nat44-ed-hairpinning",
.vector_size = sizeof (u32),
.error_strings = nat44_hairpin_error_strings,
.n_next_nodes = NAT_HAIRPIN_N_NEXT,
.next_nodes = {
[NAT_HAIRPIN_NEXT_DROP] = "error-drop",
[NAT_HAIRPIN_NEXT_LOOKUP] = "ip4-lookup",
},
}
static char * nat44_hairpin_error_strings[]
unsigned int u32
Definition: types.h:88
vl_api_fib_path_type_t type
Definition: fib_types.api:123
#define ARRAY_LEN(x)
Definition: clib.h:62

(constructor) VLIB_REGISTER_NODE (nat44_ed_hairpinning_node)

Definition at line 642 of file nat44_hairpinning.c.

◆ nat44_hairpin_error_strings

char* nat44_hairpin_error_strings[]
static
Initial value:
= {
#define _(sym,string)
}
#define foreach_nat44_hairpin_error

Definition at line 53 of file nat44_hairpinning.c.

◆ nat44_hairpinning_node

vlib_node_registration_t nat44_hairpinning_node
Initial value:
= {
.name = "nat44-hairpinning",
.vector_size = sizeof (u32),
.error_strings = nat44_hairpin_error_strings,
.n_next_nodes = NAT_HAIRPIN_N_NEXT,
.next_nodes = {
[NAT_HAIRPIN_NEXT_DROP] = "error-drop",
[NAT_HAIRPIN_NEXT_LOOKUP] = "ip4-lookup",
},
}
static char * nat44_hairpin_error_strings[]
unsigned int u32
Definition: types.h:88
vl_api_fib_path_type_t type
Definition: fib_types.api:123
#define ARRAY_LEN(x)
Definition: clib.h:62

(constructor) VLIB_REGISTER_NODE (nat44_hairpinning_node)

Definition at line 620 of file nat44_hairpinning.c.

◆ snat_hairpin_dst_node

vlib_node_registration_t snat_hairpin_dst_node
Initial value:
= {
.name = "nat44-hairpin-dst",
.vector_size = sizeof (u32),
.error_strings = nat44_hairpin_error_strings,
.n_next_nodes = NAT_HAIRPIN_N_NEXT,
.next_nodes = {
[NAT_HAIRPIN_NEXT_DROP] = "error-drop",
[NAT_HAIRPIN_NEXT_LOOKUP] = "ip4-lookup",
},
}
static char * nat44_hairpin_error_strings[]
unsigned int u32
Definition: types.h:88
vl_api_fib_path_type_t type
Definition: fib_types.api:123
#define ARRAY_LEN(x)
Definition: clib.h:62

(constructor) VLIB_REGISTER_NODE (snat_hairpin_dst_node)

Definition at line 752 of file nat44_hairpinning.c.

◆ snat_hairpin_src_node

vlib_node_registration_t snat_hairpin_src_node
Initial value:
= {
.name = "nat44-hairpin-src",
.vector_size = sizeof (u32),
.error_strings = nat44_hairpin_error_strings,
.n_next_nodes = SNAT_HAIRPIN_SRC_N_NEXT,
.next_nodes = {
[SNAT_HAIRPIN_SRC_NEXT_DROP] = "error-drop",
[SNAT_HAIRPIN_SRC_NEXT_SNAT_IN2OUT] = "nat44-in2out-output",
[SNAT_HAIRPIN_SRC_NEXT_SNAT_IN2OUT_WH] = "nat44-in2out-output-worker-handoff",
},
}
static char * nat44_hairpin_error_strings[]
unsigned int u32
Definition: types.h:88
vl_api_fib_path_type_t type
Definition: fib_types.api:123
#define ARRAY_LEN(x)
Definition: clib.h:62

(constructor) VLIB_REGISTER_NODE (snat_hairpin_src_node)

Definition at line 874 of file nat44_hairpinning.c.

◆ vnet_feat_arc_ip4_local

vnet_feature_arc_registration_t vnet_feat_arc_ip4_local