FD.io VPP  v18.10-32-g1161dda
Vector Packet Processing
out2in_ed.c File Reference

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

+ Include dependency graph for out2in_ed.c:

Go to the source code of this file.

Data Structures

struct  nat44_ed_out2in_trace_t
 

Macros

#define foreach_nat_out2in_ed_error
 

Enumerations

enum  nat_out2in_ed_error_t { NAT_OUT2IN_ED_N_ERROR }
 
enum  nat44_ed_out2in_next_t {
  NAT44_ED_OUT2IN_NEXT_DROP, NAT44_ED_OUT2IN_NEXT_LOOKUP, NAT44_ED_OUT2IN_NEXT_ICMP_ERROR, NAT44_ED_OUT2IN_NEXT_IN2OUT,
  NAT44_ED_OUT2IN_NEXT_SLOW_PATH, NAT44_ED_OUT2IN_NEXT_REASS, NAT44_ED_OUT2IN_N_NEXT
}
 

Functions

static u8format_nat44_ed_out2in_trace (u8 *s, va_list *args)
 
static u32 icmp_out2in_ed_slow_path (snat_main_t *sm, vlib_buffer_t *b0, ip4_header_t *ip0, icmp46_header_t *icmp0, u32 sw_if_index0, u32 rx_fib_index0, vlib_node_runtime_t *node, u32 next0, f64 now, u32 thread_index, snat_session_t **p_s0)
 
int nat44_o2i_ed_is_idle_session_cb (clib_bihash_kv_16_8_t *kv, void *arg)
 
static snat_session_t * create_session_for_static_mapping_ed (snat_main_t *sm, vlib_buffer_t *b, snat_session_key_t l_key, snat_session_key_t e_key, vlib_node_runtime_t *node, u32 thread_index, twice_nat_type_t twice_nat, lb_nat_type_t lb_nat, f64 now)
 
static_always_inline int icmp_get_ed_key (ip4_header_t *ip0, nat_ed_ses_key_t *p_key0)
 
static int next_src_nat (snat_main_t *sm, ip4_header_t *ip, u8 proto, u16 src_port, u16 dst_port, u32 thread_index, u32 rx_fib_index)
 
static void create_bypass_for_fwd (snat_main_t *sm, ip4_header_t *ip, u32 rx_fib_index, u32 thread_index)
 
u32 icmp_match_out2in_ed (snat_main_t *sm, vlib_node_runtime_t *node, u32 thread_index, vlib_buffer_t *b, ip4_header_t *ip, u8 *p_proto, snat_session_key_t *p_value, u8 *p_dont_translate, void *d, void *e)
 
static snat_session_t * nat44_ed_out2in_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_node_fn_inline (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, int is_slow_path)
 
static uword nat44_ed_out2in_fast_path_fn (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 
 VLIB_NODE_FUNCTION_MULTIARCH (nat44_ed_out2in_node, nat44_ed_out2in_fast_path_fn)
 
static uword nat44_ed_out2in_slow_path_fn (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 
 VLIB_NODE_FUNCTION_MULTIARCH (nat44_ed_out2in_slowpath_node, nat44_ed_out2in_slow_path_fn)
 
static uword nat44_ed_out2in_reass_node_fn (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 
 VLIB_NODE_FUNCTION_MULTIARCH (nat44_ed_out2in_reass_node, nat44_ed_out2in_reass_node_fn)
 

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 nat44_ed_out2in_reass_node
 (constructor) VLIB_REGISTER_NODE (nat44_ed_out2in_reass_node) More...
 

Detailed Description

NAT44 endpoint-dependent outside to inside network translation.

Definition in file out2in_ed.c.

Macro Definition Documentation

#define foreach_nat_out2in_ed_error
Value:
_(UNSUPPORTED_PROTOCOL, "Unsupported protocol") \
_(OUT2IN_PACKETS, "Good out2in packets processed") \
_(OUT_OF_PORTS, "Out of ports") \
_(BAD_ICMP_TYPE, "unsupported ICMP type") \
_(NO_TRANSLATION, "No translation") \
_(MAX_SESSIONS_EXCEEDED, "Maximum sessions exceeded") \
_(DROP_FRAGMENT, "Drop fragment") \
_(MAX_REASS, "Maximum reassemblies exceeded") \
_(MAX_FRAG, "Maximum fragments per reassembly exceeded")\
_(NON_SYN, "non-SYN packet try to create session")

Definition at line 33 of file out2in_ed.c.

Enumeration Type Documentation

Enumerator
NAT44_ED_OUT2IN_NEXT_DROP 
NAT44_ED_OUT2IN_NEXT_LOOKUP 
NAT44_ED_OUT2IN_NEXT_ICMP_ERROR 
NAT44_ED_OUT2IN_NEXT_IN2OUT 
NAT44_ED_OUT2IN_NEXT_SLOW_PATH 
NAT44_ED_OUT2IN_NEXT_REASS 
NAT44_ED_OUT2IN_N_NEXT 

Definition at line 59 of file out2in_ed.c.

Enumerator
NAT_OUT2IN_ED_N_ERROR 

Definition at line 45 of file out2in_ed.c.

Function Documentation

static void create_bypass_for_fwd ( snat_main_t sm,
ip4_header_t ip,
u32  rx_fib_index,
u32  thread_index 
)
static

Definition at line 374 of file out2in_ed.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static snat_session_t* create_session_for_static_mapping_ed ( snat_main_t sm,
vlib_buffer_t b,
snat_session_key_t  l_key,
snat_session_key_t  e_key,
vlib_node_runtime_t node,
u32  thread_index,
twice_nat_type_t  twice_nat,
lb_nat_type_t  lb_nat,
f64  now 
)
static

Definition at line 207 of file out2in_ed.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 83 of file out2in_ed.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static_always_inline int icmp_get_ed_key ( ip4_header_t ip0,
nat_ed_ses_key_t p_key0 
)

Definition at line 310 of file out2in_ed.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

u32 icmp_match_out2in_ed ( snat_main_t sm,
vlib_node_runtime_t node,
u32  thread_index,
vlib_buffer_t b,
ip4_header_t ip,
u8 p_proto,
snat_session_key_t p_value,
u8 p_dont_translate,
void *  d,
void *  e 
)

Definition at line 464 of file out2in_ed.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static u32 icmp_out2in_ed_slow_path ( snat_main_t sm,
vlib_buffer_t b0,
ip4_header_t ip0,
icmp46_header_t *  icmp0,
u32  sw_if_index0,
u32  rx_fib_index0,
vlib_node_runtime_t node,
u32  next0,
f64  now,
u32  thread_index,
snat_session_t **  p_s0 
)
inlinestatic

Definition at line 101 of file out2in_ed.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 1490 of file out2in_ed.c.

+ Here is the call graph for this function:

static uword nat44_ed_out2in_node_fn_inline ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t frame,
int  is_slow_path 
)
inlinestatic

Definition at line 684 of file out2in_ed.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 1556 of file out2in_ed.c.

+ Here is the call graph for this function:

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

Definition at line 1523 of file out2in_ed.c.

+ Here is the call graph for this function:

static snat_session_t* nat44_ed_out2in_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 580 of file out2in_ed.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int nat44_o2i_ed_is_idle_session_cb ( clib_bihash_kv_16_8_t kv,
void *  arg 
)

Definition at line 123 of file out2in_ed.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 359 of file out2in_ed.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

VLIB_NODE_FUNCTION_MULTIARCH ( nat44_ed_out2in_node  ,
nat44_ed_out2in_fast_path_fn   
)

+ Here is the caller graph for this function:

VLIB_NODE_FUNCTION_MULTIARCH ( nat44_ed_out2in_slowpath_node  ,
nat44_ed_out2in_slow_path_fn   
)
VLIB_NODE_FUNCTION_MULTIARCH ( nat44_ed_out2in_reass_node  ,
nat44_ed_out2in_reass_node_fn   
)

Variable Documentation

vlib_node_registration_t nat44_ed_out2in_node
Initial value:
= {
.name = "nat44-ed-out2in",
.vector_size = sizeof (u32),
.error_strings = nat_out2in_ed_error_strings,
.runtime_data_bytes = sizeof (snat_runtime_t),
.n_next_nodes = NAT44_ED_OUT2IN_N_NEXT,
.next_nodes = {
[NAT44_ED_OUT2IN_NEXT_DROP] = "error-drop",
[NAT44_ED_OUT2IN_NEXT_LOOKUP] = "ip4-lookup",
[NAT44_ED_OUT2IN_NEXT_SLOW_PATH] = "nat44-ed-out2in-slowpath",
[NAT44_ED_OUT2IN_NEXT_ICMP_ERROR] = "ip4-icmp-error",
[NAT44_ED_OUT2IN_NEXT_IN2OUT] = "nat44-ed-in2out",
[NAT44_ED_OUT2IN_NEXT_REASS] = "nat44-ed-out2in-reass",
},
}
static char * nat_out2in_ed_error_strings[]
Definition: out2in_ed.c:53
static uword nat44_ed_out2in_fast_path_fn(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
Definition: out2in_ed.c:1490
unsigned int u32
Definition: types.h:88
static u8 * format_nat44_ed_out2in_trace(u8 *s, va_list *args)
Definition: out2in_ed.c:83
#define ARRAY_LEN(x)
Definition: clib.h:61

(constructor) VLIB_REGISTER_NODE (nat44_ed_out2in_node)

Definition at line 78 of file out2in_ed.c.

vlib_node_registration_t nat44_ed_out2in_reass_node
Initial value:
= {
.name = "nat44-ed-out2in-reass",
.vector_size = sizeof (u32),
.format_trace = format_nat44_reass_trace,
.error_strings = nat_out2in_ed_error_strings,
.n_next_nodes = NAT44_ED_OUT2IN_N_NEXT,
.next_nodes = {
[NAT44_ED_OUT2IN_NEXT_DROP] = "error-drop",
[NAT44_ED_OUT2IN_NEXT_LOOKUP] = "ip4-lookup",
[NAT44_ED_OUT2IN_NEXT_SLOW_PATH] = "nat44-ed-out2in-slowpath",
[NAT44_ED_OUT2IN_NEXT_ICMP_ERROR] = "ip4-icmp-error",
[NAT44_ED_OUT2IN_NEXT_IN2OUT] = "nat44-ed-in2out",
[NAT44_ED_OUT2IN_NEXT_REASS] = "nat44-ed-out2in-reass",
},
}
static char * nat_out2in_ed_error_strings[]
Definition: out2in_ed.c:53
unsigned int u32
Definition: types.h:88
#define ARRAY_LEN(x)
Definition: clib.h:61
static uword nat44_ed_out2in_reass_node_fn(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
Definition: out2in_ed.c:1556
format_function_t format_nat44_reass_trace
Definition: nat.h:590

(constructor) VLIB_REGISTER_NODE (nat44_ed_out2in_reass_node)

Definition at line 80 of file out2in_ed.c.

vlib_node_registration_t nat44_ed_out2in_slowpath_node
Initial value:
= {
.name = "nat44-ed-out2in-slowpath",
.vector_size = sizeof (u32),
.error_strings = nat_out2in_ed_error_strings,
.runtime_data_bytes = sizeof (snat_runtime_t),
.n_next_nodes = NAT44_ED_OUT2IN_N_NEXT,
.next_nodes = {
[NAT44_ED_OUT2IN_NEXT_DROP] = "error-drop",
[NAT44_ED_OUT2IN_NEXT_LOOKUP] = "ip4-lookup",
[NAT44_ED_OUT2IN_NEXT_SLOW_PATH] = "nat44-ed-out2in-slowpath",
[NAT44_ED_OUT2IN_NEXT_ICMP_ERROR] = "ip4-icmp-error",
[NAT44_ED_OUT2IN_NEXT_IN2OUT] = "nat44-ed-in2out",
[NAT44_ED_OUT2IN_NEXT_REASS] = "nat44-ed-out2in-reass",
},
}
static char * nat_out2in_ed_error_strings[]
Definition: out2in_ed.c:53
unsigned int u32
Definition: types.h:88
static u8 * format_nat44_ed_out2in_trace(u8 *s, va_list *args)
Definition: out2in_ed.c:83
#define ARRAY_LEN(x)
Definition: clib.h:61
static uword nat44_ed_out2in_slow_path_fn(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
Definition: out2in_ed.c:1523

(constructor) VLIB_REGISTER_NODE (nat44_ed_out2in_slowpath_node)

Definition at line 79 of file out2in_ed.c.

char* nat_out2in_ed_error_strings[]
static
Initial value:
= {
#define _(sym,string)
}
#define foreach_nat_out2in_ed_error
Definition: out2in_ed.c:33

Definition at line 53 of file out2in_ed.c.