FD.io VPP  v21.01.1
Vector Packet Processing
det44_out2in.c File Reference

Deterministic NAT (CGN) outside to inside translation. More...

+ Include dependency graph for det44_out2in.c:

Go to the source code of this file.

Data Structures

struct  det44_out2in_trace_t
 

Macros

#define foreach_det44_out2in_error
 

Enumerations

enum  det44_out2in_next_t { DET44_OUT2IN_NEXT_DROP, DET44_OUT2IN_NEXT_LOOKUP, DET44_OUT2IN_NEXT_ICMP_ERROR, DET44_OUT2IN_N_NEXT }
 
enum  det44_out2in_error_t { DET44_OUT2IN_N_ERROR }
 

Functions

static u8format_det44_out2in_trace (u8 *s, va_list *args)
 
u32 icmp_match_out2in_det (vlib_node_runtime_t *node, u32 thread_index, vlib_buffer_t *b0, ip4_header_t *ip0, ip4_address_t *addr, u16 *port, u32 *fib_index, nat_protocol_t *proto, void *d, void *e, u8 *dont_translate)
 Get address and port values to be used for ICMP packet translation and create session if needed. More...
 
u32 det44_icmp_out2in (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, u32 thread_index, void *d, void *e)
 
VLIB_NODE_FN() det44_out2in_node (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 

Variables

static char * det44_out2in_error_strings []
 
vlib_node_registration_t det44_out2in_node
 (constructor) VLIB_REGISTER_NODE (det44_out2in_node) More...
 

Detailed Description

Deterministic NAT (CGN) outside to inside translation.

Definition in file det44_out2in.c.

Macro Definition Documentation

◆ foreach_det44_out2in_error

#define foreach_det44_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 50 of file det44_out2in.c.

Enumeration Type Documentation

◆ det44_out2in_error_t

Enumerator
DET44_OUT2IN_N_ERROR 

Definition at line 56 of file det44_out2in.c.

◆ det44_out2in_next_t

Enumerator
DET44_OUT2IN_NEXT_DROP 
DET44_OUT2IN_NEXT_LOOKUP 
DET44_OUT2IN_NEXT_ICMP_ERROR 
DET44_OUT2IN_N_NEXT 

Definition at line 35 of file det44_out2in.c.

Function Documentation

◆ det44_icmp_out2in()

u32 det44_icmp_out2in ( 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,
u32  thread_index,
void *  d,
void *  e 
)

Definition at line 233 of file det44_out2in.c.

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

◆ det44_out2in_node()

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

Definition at line 367 of file det44_out2in.c.

+ Here is the call graph for this function:

◆ format_det44_out2in_trace()

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

Definition at line 71 of file det44_out2in.c.

◆ icmp_match_out2in_det()

u32 icmp_match_out2in_det ( vlib_node_runtime_t node,
u32  thread_index,
vlib_buffer_t b0,
ip4_header_t ip0,
ip4_address_t addr,
u16 port,
u32 fib_index,
nat_protocol_t proto,
void *  d,
void *  e,
u8 dont_translate 
)

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

Parameters
[in,out]nodeNAT node runtime
[in]thread_indexthread index
[in,out]b0buffer containing packet to be translated
[in,out]ip0ip header
[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 100 of file det44_out2in.c.

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

Variable Documentation

◆ det44_out2in_error_strings

char* det44_out2in_error_strings[]
static
Initial value:
= {
#define _(sym,string)
}
#define foreach_det44_out2in_error
Definition: det44_out2in.c:50

Definition at line 64 of file det44_out2in.c.

◆ det44_out2in_node

vlib_node_registration_t det44_out2in_node
Initial value:
= {
.name = "det44-out2in",
.vector_size = sizeof (u32),
.format_trace = format_det44_out2in_trace,
.error_strings = det44_out2in_error_strings,
.runtime_data_bytes = sizeof (det44_runtime_t),
.n_next_nodes = DET44_OUT2IN_N_NEXT,
.next_nodes = {
[DET44_OUT2IN_NEXT_DROP] = "error-drop",
[DET44_OUT2IN_NEXT_LOOKUP] = "ip4-lookup",
[DET44_OUT2IN_NEXT_ICMP_ERROR] = "ip4-icmp-error",
},
}
unsigned int u32
Definition: types.h:88
static char * det44_out2in_error_strings[]
Definition: det44_out2in.c:64
vl_api_fib_path_type_t type
Definition: fib_types.api:123
#define ARRAY_LEN(x)
Definition: clib.h:67
static u8 * format_det44_out2in_trace(u8 *s, va_list *args)
Definition: det44_out2in.c:71

(constructor) VLIB_REGISTER_NODE (det44_out2in_node)

Definition at line 819 of file det44_out2in.c.