FD.io VPP  v19.04-6-g6f05f72
Vector Packet Processing
nat_det_out2in.c File Reference

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

+ Include dependency graph for nat_det_out2in.c:

Go to the source code of this file.

Data Structures

struct  nat_det_out2in_trace_t
 

Macros

#define foreach_nat_det_out2in_error
 

Enumerations

enum  nat_det_out2in_next_t { NAT_DET_OUT2IN_NEXT_DROP, NAT_DET_OUT2IN_NEXT_LOOKUP, NAT_DET_OUT2IN_NEXT_ICMP_ERROR, NAT_DET_OUT2IN_N_NEXT }
 
enum  nat_det_out2in_error_t { SNAT_OUT2IN_N_ERROR }
 

Functions

static u8format_nat_det_out2in_trace (u8 *s, va_list *args)
 
u32 icmp_match_out2in_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_out2in_node (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 

Variables

static char * nat_det_out2in_error_strings []
 
vlib_node_registration_t snat_det_out2in_node
 (constructor) VLIB_REGISTER_NODE (snat_det_out2in_node) More...
 

Detailed Description

Deterministic/CGN NAT44 outside to inside network translation.

Definition in file nat_det_out2in.c.

Macro Definition Documentation

#define foreach_nat_det_out2in_error
Value:
_(UNSUPPORTED_PROTOCOL, "Unsupported protocol") \
_(NO_TRANSLATION, "No translation") \
_(BAD_ICMP_TYPE, "unsupported ICMP type") \
_(OUT2IN_PACKETS, "Good out2in packets processed")

Definition at line 45 of file nat_det_out2in.c.

Enumeration Type Documentation

Enumerator
SNAT_OUT2IN_N_ERROR 

Definition at line 51 of file nat_det_out2in.c.

Enumerator
NAT_DET_OUT2IN_NEXT_DROP 
NAT_DET_OUT2IN_NEXT_LOOKUP 
NAT_DET_OUT2IN_NEXT_ICMP_ERROR 
NAT_DET_OUT2IN_N_NEXT 

Definition at line 30 of file nat_det_out2in.c.

Function Documentation

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

Definition at line 66 of file nat_det_out2in.c.

+ Here is the call graph for this function:

u32 icmp_match_out2in_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_out2in.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 221 of file nat_det_out2in.c.

+ Here is the call graph for this function:

Variable Documentation

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

Definition at line 59 of file nat_det_out2in.c.

vlib_node_registration_t snat_det_out2in_node
Initial value:
= {
.name = "nat44-det-out2in",
.vector_size = sizeof (u32),
.format_trace = format_nat_det_out2in_trace,
.error_strings = nat_det_out2in_error_strings,
.runtime_data_bytes = sizeof (snat_runtime_t),
.n_next_nodes = NAT_DET_OUT2IN_N_NEXT,
.next_nodes = {
[NAT_DET_OUT2IN_NEXT_DROP] = "error-drop",
[NAT_DET_OUT2IN_NEXT_LOOKUP] = "ip4-lookup",
[NAT_DET_OUT2IN_NEXT_ICMP_ERROR] = "ip4-icmp-error",
},
}
unsigned int u32
Definition: types.h:88
static char * nat_det_out2in_error_strings[]
static u8 * format_nat_det_out2in_trace(u8 *s, va_list *args)
#define ARRAY_LEN(x)
Definition: clib.h:62

(constructor) VLIB_REGISTER_NODE (snat_det_out2in_node)

Definition at line 690 of file nat_det_out2in.c.