FD.io VPP  v21.10.1-2-g0a485f517
Vector Packet Processing
nat44_ed_out2in.c File Reference

NAT44 endpoint-dependent outside to inside network translation. More...

+ Include dependency graph for nat44_ed_out2in.c:

Go to the source code of this file.

Data Structures

struct  nat44_ed_out2in_trace_t
 

Enumerations

enum  nat_slow_path_reason_e {
  NAT_ED_SP_REASON_NO_REASON, NAT_ED_SP_REASON_LOOKUP_FAILED, NAT_ED_SP_REASON_VRF_EXPIRED, NAT_ED_SP_TCP_CLOSED,
  NAT_ED_SP_SESS_EXPIRED
}
 

Functions

static u8format_slow_path_reason (u8 *s, va_list *args)
 
static u8format_nat44_ed_out2in_trace (u8 *s, va_list *args)
 
static int next_src_nat (snat_main_t *sm, ip4_header_t *ip, u16 src_port, u16 dst_port, u32 rx_fib_index)
 
static void create_bypass_for_fwd (snat_main_t *sm, vlib_buffer_t *b, snat_session_t *s, ip4_header_t *ip, u32 rx_fib_index, u32 thread_index)
 
static snat_session_t * create_session_for_static_mapping_ed (snat_main_t *sm, vlib_buffer_t *b, ip4_address_t i2o_addr, u16 i2o_port, u32 i2o_fib_index, ip4_address_t o2i_addr, u16 o2i_port, u32 o2i_fib_index, nat_protocol_t nat_proto, vlib_node_runtime_t *node, u32 rx_fib_index, u32 thread_index, twice_nat_type_t twice_nat, lb_nat_type_t lb_nat, f64 now, snat_static_mapping_t *mapping)
 
static u32 icmp_out2in_ed_slow_path (snat_main_t *sm, vlib_buffer_t *b, ip4_header_t *ip, icmp46_header_t *icmp, u32 sw_if_index, u32 rx_fib_index, vlib_node_runtime_t *node, u32 next, f64 now, u32 thread_index, snat_session_t **s_p)
 
static_always_inline int nat_alloc_addr_and_port_exact (snat_address_t *a, u32 thread_index, nat_protocol_t proto, ip4_address_t *addr, u16 *port, u16 port_per_thread, u32 snat_thread_index)
 
static_always_inline int nat44_ed_alloc_outside_addr_and_port (snat_address_t *addresses, u32 fib_index, u32 thread_index, nat_protocol_t proto, ip4_address_t *addr, u16 *port, u16 port_per_thread, u32 snat_thread_index)
 
static snat_session_t * nat44_ed_out2in_slowpath_unknown_proto (snat_main_t *sm, vlib_buffer_t *b, ip4_header_t *ip, u32 rx_fib_index, u32 thread_index, f64 now, vlib_main_t *vm, vlib_node_runtime_t *node)
 
static uword nat44_ed_out2in_fast_path_node_fn_inline (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, int is_multi_worker)
 
static uword nat44_ed_out2in_slow_path_node_fn_inline (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 
VLIB_NODE_FN() nat44_ed_out2in_node (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 
VLIB_NODE_FN() nat44_ed_out2in_slowpath_node (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 
static u8format_nat_pre_trace (u8 *s, va_list *args)
 
VLIB_NODE_FN() nat_pre_out2in_node (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 

Variables

static char * nat_out2in_ed_error_strings []
 
vlib_node_registration_t nat44_ed_out2in_node
 (constructor) VLIB_REGISTER_NODE (nat44_ed_out2in_node) More...
 
vlib_node_registration_t nat44_ed_out2in_slowpath_node
 (constructor) VLIB_REGISTER_NODE (nat44_ed_out2in_slowpath_node) More...
 
vlib_node_registration_t nat_pre_out2in_node
 (constructor) VLIB_REGISTER_NODE (nat_pre_out2in_node) More...
 

Detailed Description

NAT44 endpoint-dependent outside to inside network translation.

Definition in file nat44_ed_out2in.c.

Enumeration Type Documentation

◆ nat_slow_path_reason_e

Enumerator
NAT_ED_SP_REASON_NO_REASON 
NAT_ED_SP_REASON_LOOKUP_FAILED 
NAT_ED_SP_REASON_VRF_EXPIRED 
NAT_ED_SP_TCP_CLOSED 
NAT_ED_SP_SESS_EXPIRED 

Definition at line 40 of file nat44_ed_out2in.c.

Function Documentation

◆ create_bypass_for_fwd()

static void create_bypass_for_fwd ( snat_main_t sm,
vlib_buffer_t b,
snat_session_t *  s,
ip4_header_t ip,
u32  rx_fib_index,
u32  thread_index 
)
static

Definition at line 602 of file nat44_ed_out2in.c.

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

◆ create_session_for_static_mapping_ed()

static snat_session_t * create_session_for_static_mapping_ed ( snat_main_t sm,
vlib_buffer_t b,
ip4_address_t  i2o_addr,
u16  i2o_port,
u32  i2o_fib_index,
ip4_address_t  o2i_addr,
u16  o2i_port,
u32  o2i_fib_index,
nat_protocol_t  nat_proto,
vlib_node_runtime_t node,
u32  rx_fib_index,
u32  thread_index,
twice_nat_type_t  twice_nat,
lb_nat_type_t  lb_nat,
f64  now,
snat_static_mapping_t mapping 
)
static

Definition at line 397 of file nat44_ed_out2in.c.

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

◆ format_nat44_ed_out2in_trace()

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

Definition at line 85 of file nat44_ed_out2in.c.

+ Here is the call graph for this function:

◆ format_nat_pre_trace()

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

Definition at line 1436 of file nat44_ed_out2in.c.

◆ format_slow_path_reason()

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

Definition at line 65 of file nat44_ed_out2in.c.

+ Here is the caller graph for this function:

◆ icmp_out2in_ed_slow_path()

static u32 icmp_out2in_ed_slow_path ( snat_main_t sm,
vlib_buffer_t b,
ip4_header_t ip,
icmp46_header_t *  icmp,
u32  sw_if_index,
u32  rx_fib_index,
vlib_node_runtime_t node,
u32  next,
f64  now,
u32  thread_index,
snat_session_t **  s_p 
)
inlinestatic

Definition at line 150 of file nat44_ed_out2in.c.

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

◆ nat44_ed_alloc_outside_addr_and_port()

static_always_inline int nat44_ed_alloc_outside_addr_and_port ( snat_address_t addresses,
u32  fib_index,
u32  thread_index,
nat_protocol_t  proto,
ip4_address_t addr,
u16 port,
u16  port_per_thread,
u32  snat_thread_index 
)

Definition at line 314 of file nat44_ed_out2in.c.

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

◆ nat44_ed_out2in_fast_path_node_fn_inline()

static uword nat44_ed_out2in_fast_path_node_fn_inline ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t frame,
int  is_multi_worker 
)
inlinestatic

Definition at line 794 of file nat44_ed_out2in.c.

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

◆ nat44_ed_out2in_node()

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

Definition at line 1392 of file nat44_ed_out2in.c.

+ Here is the call graph for this function:

◆ nat44_ed_out2in_slow_path_node_fn_inline()

static uword nat44_ed_out2in_slow_path_node_fn_inline ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t frame 
)
inlinestatic

Definition at line 1113 of file nat44_ed_out2in.c.

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

◆ nat44_ed_out2in_slowpath_node()

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

Definition at line 1417 of file nat44_ed_out2in.c.

+ Here is the call graph for this function:

◆ nat44_ed_out2in_slowpath_unknown_proto()

static snat_session_t* nat44_ed_out2in_slowpath_unknown_proto ( snat_main_t sm,
vlib_buffer_t b,
ip4_header_t ip,
u32  rx_fib_index,
u32  thread_index,
f64  now,
vlib_main_t vm,
vlib_node_runtime_t node 
)
static

Definition at line 716 of file nat44_ed_out2in.c.

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

◆ nat_alloc_addr_and_port_exact()

static_always_inline int nat_alloc_addr_and_port_exact ( snat_address_t a,
u32  thread_index,
nat_protocol_t  proto,
ip4_address_t addr,
u16 port,
u16  port_per_thread,
u32  snat_thread_index 
)

Definition at line 270 of file nat44_ed_out2in.c.

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

◆ nat_pre_out2in_node()

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

Definition at line 1445 of file nat44_ed_out2in.c.

+ Here is the call graph for this function:

◆ next_src_nat()

static int next_src_nat ( snat_main_t sm,
ip4_header_t ip,
u16  src_port,
u16  dst_port,
u32  rx_fib_index 
)
static

Definition at line 125 of file nat44_ed_out2in.c.

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

Variable Documentation

◆ nat44_ed_out2in_node

vlib_node_registration_t nat44_ed_out2in_node
Initial value:
= {
.name = "nat44-ed-out2in",
.vector_size = sizeof (u32),
.sibling_of = "nat-default",
.error_strings = nat_out2in_ed_error_strings,
.runtime_data_bytes = sizeof (snat_runtime_t),
}

(constructor) VLIB_REGISTER_NODE (nat44_ed_out2in_node)

Definition at line 1406 of file nat44_ed_out2in.c.

◆ nat44_ed_out2in_slowpath_node

vlib_node_registration_t nat44_ed_out2in_slowpath_node
Initial value:
= {
.name = "nat44-ed-out2in-slowpath",
.vector_size = sizeof (u32),
.sibling_of = "nat-default",
.error_strings = nat_out2in_ed_error_strings,
.runtime_data_bytes = sizeof (snat_runtime_t),
}

(constructor) VLIB_REGISTER_NODE (nat44_ed_out2in_slowpath_node)

Definition at line 1424 of file nat44_ed_out2in.c.

◆ nat_out2in_ed_error_strings

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

Definition at line 34 of file nat44_ed_out2in.c.

◆ nat_pre_out2in_node

vlib_node_registration_t nat_pre_out2in_node
Initial value:
= {
.name = "nat-pre-out2in",
.vector_size = sizeof (u32),
.sibling_of = "nat-default",
.format_trace = format_nat_pre_trace,
.n_errors = 0,
}

(constructor) VLIB_REGISTER_NODE (nat_pre_out2in_node)

Definition at line 1453 of file nat44_ed_out2in.c.

VLIB_NODE_TYPE_INTERNAL
@ VLIB_NODE_TYPE_INTERNAL
Definition: node.h:72
ARRAY_LEN
#define ARRAY_LEN(x)
Definition: clib.h:70
u32
unsigned int u32
Definition: types.h:88
format_nat44_ed_out2in_trace
static u8 * format_nat44_ed_out2in_trace(u8 *s, va_list *args)
Definition: nat44_ed_out2in.c:85
snat_runtime_t
Definition: nat44_ed.h:686
foreach_nat_out2in_ed_error
#define foreach_nat_out2in_ed_error
Definition: nat44_ed.h:144
format_nat_pre_trace
static u8 * format_nat_pre_trace(u8 *s, va_list *args)
Definition: nat44_ed_out2in.c:1436
nat_out2in_ed_error_strings
static char * nat_out2in_ed_error_strings[]
Definition: nat44_ed_out2in.c:34
type
vl_api_fib_path_type_t type
Definition: fib_types.api:123