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

Deterministic/CGN NAT44 inside to outside network translation. More...

+ Include dependency graph for nat_det_in2out.c:

Go to the source code of this file.

Data Structures

struct  nat_det_in2out_trace_t
 

Macros

#define foreach_nat_det_in2out_error
 

Enumerations

enum  nat_det_in2out_next_t { NAT_DET_IN2OUT_NEXT_LOOKUP, NAT_DET_IN2OUT_NEXT_DROP, NAT_DET_IN2OUT_NEXT_ICMP_ERROR, NAT_DET_IN2OUT_N_NEXT }
 
enum  nat_det_in2out_error_t { NAT_DET_IN2OUT_N_ERROR }
 

Functions

static u8format_nat_det_in2out_trace (u8 *s, va_list *args)
 
u32 icmp_match_in2out_det (snat_main_t *sm, vlib_node_runtime_t *node, u32 thread_index, vlib_buffer_t *b0, ip4_header_t *ip0, u8 *p_proto, snat_session_key_t *p_value, u8 *p_dont_translate, void *d, void *e)
 Get address and port values to be used for ICMP packet translation and create session if needed. More...
 
VLIB_NODE_FN() snat_det_in2out_node (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 

Variables

static char * nat_det_in2out_error_strings []
 
vlib_node_registration_t snat_det_in2out_node
 (constructor) VLIB_REGISTER_NODE (snat_det_in2out_node) More...
 

Detailed Description

Deterministic/CGN NAT44 inside to outside network translation.

Definition in file nat_det_in2out.c.

Macro Definition Documentation

◆ foreach_nat_det_in2out_error

#define foreach_nat_det_in2out_error
Value:
_(UNSUPPORTED_PROTOCOL, "Unsupported protocol") \
_(NO_TRANSLATION, "No translation") \
_(BAD_ICMP_TYPE, "unsupported ICMP type") \
_(OUT_OF_PORTS, "Out of ports") \
_(IN2OUT_PACKETS, "Good in2out packets processed")

Definition at line 45 of file nat_det_in2out.c.

Enumeration Type Documentation

◆ nat_det_in2out_error_t

Enumerator
NAT_DET_IN2OUT_N_ERROR 

Definition at line 52 of file nat_det_in2out.c.

◆ nat_det_in2out_next_t

Enumerator
NAT_DET_IN2OUT_NEXT_LOOKUP 
NAT_DET_IN2OUT_NEXT_DROP 
NAT_DET_IN2OUT_NEXT_ICMP_ERROR 
NAT_DET_IN2OUT_N_NEXT 

Definition at line 37 of file nat_det_in2out.c.

Function Documentation

◆ format_nat_det_in2out_trace()

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

Definition at line 67 of file nat_det_in2out.c.

+ Here is the call graph for this function:

◆ icmp_match_in2out_det()

u32 icmp_match_in2out_det ( snat_main_t sm,
vlib_node_runtime_t node,
u32  thread_index,
vlib_buffer_t b0,
ip4_header_t ip0,
u8 p_proto,
snat_session_key_t p_value,
u8 p_dont_translate,
void *  d,
void *  e 
)

Get address and port values to be used for ICMP packet translation and create session if needed.

Parameters
[in,out]smNAT main
[in,out]nodeNAT node runtime
[in]thread_indexthread index
[in,out]b0buffer containing packet to be translated
[out]p_protoprotocol used for matching
[out]p_valueaddress and port after NAT translation
[out]p_dont_translateif packet should not be translated
doptional parameter
eoptional parameter

Definition at line 95 of file nat_det_in2out.c.

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

◆ snat_det_in2out_node()

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

Definition at line 250 of file nat_det_in2out.c.

+ Here is the call graph for this function:

Variable Documentation

◆ nat_det_in2out_error_strings

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

Definition at line 60 of file nat_det_in2out.c.

◆ snat_det_in2out_node

vlib_node_registration_t snat_det_in2out_node
Initial value:
= {
.name = "nat44-det-in2out",
.vector_size = sizeof (u32),
.format_trace = format_nat_det_in2out_trace,
.error_strings = nat_det_in2out_error_strings,
.n_next_nodes = NAT_DET_IN2OUT_N_NEXT,
.next_nodes = {
[NAT_DET_IN2OUT_NEXT_DROP] = "error-drop",
[NAT_DET_IN2OUT_NEXT_LOOKUP] = "ip4-lookup",
[NAT_DET_IN2OUT_NEXT_ICMP_ERROR] = "ip4-icmp-error",
},
}
static char * nat_det_in2out_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
static u8 * format_nat_det_in2out_trace(u8 *s, va_list *args)

(constructor) VLIB_REGISTER_NODE (snat_det_in2out_node)

Definition at line 890 of file nat_det_in2out.c.