FD.io VPP  v19.01.3-6-g70449b9b9
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)
 
static uword nat44_hairpinning_fn (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 
 VLIB_NODE_FUNCTION_MULTIARCH (nat44_hairpinning_node, nat44_hairpinning_fn)
 
static uword nat44_ed_hairpinning_fn (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 
 VLIB_NODE_FUNCTION_MULTIARCH (nat44_ed_hairpinning_node, nat44_ed_hairpinning_fn)
 
static uword snat_hairpin_dst_fn_inline (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, int is_ed)
 
static uword snat_hairpin_dst_fn (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 
 VLIB_NODE_FUNCTION_MULTIARCH (snat_hairpin_dst_node, snat_hairpin_dst_fn)
 
static uword nat44_ed_hairpin_dst_fn (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 
 VLIB_NODE_FUNCTION_MULTIARCH (nat44_ed_hairpin_dst_node, nat44_ed_hairpin_dst_fn)
 
static uword snat_hairpin_src_fn_inline (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, int is_ed)
 
static uword snat_hairpin_src_fn (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 
 VLIB_NODE_FUNCTION_MULTIARCH (snat_hairpin_src_node, snat_hairpin_src_fn)
 
static uword nat44_ed_hairpin_src_fn (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 
 VLIB_NODE_FUNCTION_MULTIARCH (nat44_ed_hairpin_src_node, nat44_ed_hairpin_src_fn)
 

Variables

static char * nat44_hairpin_error_strings []
 
vlib_node_registration_t snat_hairpin_dst_node
 (constructor) VLIB_REGISTER_NODE (snat_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_hairpinning_node
 (constructor) VLIB_REGISTER_NODE (nat44_hairpinning_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 nat44_ed_hairpin_src_node
 (constructor) VLIB_REGISTER_NODE (nat44_ed_hairpin_src_node) More...
 
vlib_node_registration_t nat44_ed_hairpinning_node
 (constructor) VLIB_REGISTER_NODE (nat44_ed_hairpinning_node) More...
 
vnet_feature_arc_registration_t vnet_feat_arc_ip4_local
 

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 43 of file nat44_hairpinning.c.

Enumeration Type Documentation

◆ nat44_hairpin_error_t

Enumerator
NAT44_HAIRPIN_N_ERROR 

Definition at line 46 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 36 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 27 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 70 of file nat44_hairpinning.c.

+ Here is the caller graph for this function:

◆ nat44_ed_hairpin_dst_fn()

static uword nat44_ed_hairpin_dst_fn ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t frame 
)
static

Definition at line 774 of file nat44_hairpinning.c.

+ Here is the call graph for this function:

◆ nat44_ed_hairpin_src_fn()

static uword nat44_ed_hairpin_src_fn ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t frame 
)
static

Definition at line 905 of file nat44_hairpinning.c.

+ Here is the call graph for this function:

◆ nat44_ed_hairpinning_fn()

static uword nat44_ed_hairpinning_fn ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t frame 
)
static

Definition at line 635 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()

static uword nat44_hairpinning_fn ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t frame 
)
static

Definition at line 610 of file nat44_hairpinning.c.

+ Here is the call 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 538 of file nat44_hairpinning.c.

+ Here is the call graph for this function:
+ Here is the caller 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 427 of file nat44_hairpinning.c.

+ Here is the call graph for this function:
+ Here is the caller 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 357 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()

static uword snat_hairpin_dst_fn ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t frame 
)
static

Definition at line 749 of file nat44_hairpinning.c.

+ Here is the call 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 661 of file nat44_hairpinning.c.

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

◆ snat_hairpin_src_fn()

static uword snat_hairpin_src_fn ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t frame 
)
static

Definition at line 878 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 800 of file nat44_hairpinning.c.

+ Here is the call graph for this function:
+ Here is the caller 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 96 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 203 of file nat44_hairpinning.c.

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

◆ VLIB_NODE_FUNCTION_MULTIARCH() [1/6]

VLIB_NODE_FUNCTION_MULTIARCH ( nat44_hairpinning_node  ,
nat44_hairpinning_fn   
)
+ Here is the caller graph for this function:

◆ VLIB_NODE_FUNCTION_MULTIARCH() [2/6]

VLIB_NODE_FUNCTION_MULTIARCH ( nat44_ed_hairpinning_node  ,
nat44_ed_hairpinning_fn   
)

◆ VLIB_NODE_FUNCTION_MULTIARCH() [3/6]

VLIB_NODE_FUNCTION_MULTIARCH ( snat_hairpin_dst_node  ,
snat_hairpin_dst_fn   
)

◆ VLIB_NODE_FUNCTION_MULTIARCH() [4/6]

VLIB_NODE_FUNCTION_MULTIARCH ( nat44_ed_hairpin_dst_node  ,
nat44_ed_hairpin_dst_fn   
)

◆ VLIB_NODE_FUNCTION_MULTIARCH() [5/6]

VLIB_NODE_FUNCTION_MULTIARCH ( snat_hairpin_src_node  ,
snat_hairpin_src_fn   
)

◆ VLIB_NODE_FUNCTION_MULTIARCH() [6/6]

VLIB_NODE_FUNCTION_MULTIARCH ( nat44_ed_hairpin_src_node  ,
nat44_ed_hairpin_src_fn   
)

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
#define ARRAY_LEN(x)
Definition: clib.h:62
static uword nat44_ed_hairpin_dst_fn(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)

(constructor) VLIB_REGISTER_NODE (nat44_ed_hairpin_dst_node)

Definition at line 63 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
static uword nat44_ed_hairpin_src_fn(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
#define ARRAY_LEN(x)
Definition: clib.h:62

(constructor) VLIB_REGISTER_NODE (nat44_ed_hairpin_src_node)

Definition at line 64 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
#define ARRAY_LEN(x)
Definition: clib.h:62
static uword nat44_ed_hairpinning_fn(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)

(constructor) VLIB_REGISTER_NODE (nat44_ed_hairpinning_node)

Definition at line 65 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 54 of file nat44_hairpinning.c.

◆ nat44_hairpinning_node

vlib_node_registration_t nat44_hairpinning_node
Initial value:
= {
.function = nat44_hairpinning_fn,
.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
#define ARRAY_LEN(x)
Definition: clib.h:62
static uword nat44_hairpinning_fn(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)

(constructor) VLIB_REGISTER_NODE (nat44_hairpinning_node)

Definition at line 62 of file nat44_hairpinning.c.

◆ snat_hairpin_dst_node

vlib_node_registration_t snat_hairpin_dst_node
Initial value:
= {
.function = snat_hairpin_dst_fn,
.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
static uword snat_hairpin_dst_fn(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
#define ARRAY_LEN(x)
Definition: clib.h:62

(constructor) VLIB_REGISTER_NODE (snat_hairpin_dst_node)

Definition at line 60 of file nat44_hairpinning.c.

◆ snat_hairpin_src_node

vlib_node_registration_t snat_hairpin_src_node
Initial value:
= {
.function = snat_hairpin_src_fn,
.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 uword snat_hairpin_src_fn(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
static char * nat44_hairpin_error_strings[]
unsigned int u32
Definition: types.h:88
#define ARRAY_LEN(x)
Definition: clib.h:62

(constructor) VLIB_REGISTER_NODE (snat_hairpin_src_node)

Definition at line 61 of file nat44_hairpinning.c.

◆ vnet_feat_arc_ip4_local

vnet_feature_arc_registration_t vnet_feat_arc_ip4_local