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

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

+ Include dependency graph for det44_in2out.c:

Go to the source code of this file.

Data Structures

struct  det44_in2out_trace_t
 

Macros

#define foreach_det44_in2out_error
 

Enumerations

enum  det44_in2out_next_t { DET44_IN2OUT_NEXT_LOOKUP, DET44_IN2OUT_NEXT_DROP, DET44_IN2OUT_NEXT_ICMP_ERROR, DET44_IN2OUT_N_NEXT }
 
enum  det44_in2out_error_t { DET44_IN2OUT_N_ERROR }
 

Functions

static u8format_det44_in2out_trace (u8 *s, va_list *args)
 
u32 icmp_match_in2out_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_in2out (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_in2out_node (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 

Variables

static char * det44_in2out_error_strings []
 
vlib_node_registration_t det44_in2out_node
 (constructor) VLIB_REGISTER_NODE (det44_in2out_node) More...
 

Detailed Description

Deterministic NAT (CGN) inside to outside translation.

Definition in file det44_in2out.c.

Macro Definition Documentation

◆ foreach_det44_in2out_error

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

Enumeration Type Documentation

◆ det44_in2out_error_t

Enumerator
DET44_IN2OUT_N_ERROR 

Definition at line 57 of file det44_in2out.c.

◆ det44_in2out_next_t

Enumerator
DET44_IN2OUT_NEXT_LOOKUP 
DET44_IN2OUT_NEXT_DROP 
DET44_IN2OUT_NEXT_ICMP_ERROR 
DET44_IN2OUT_N_NEXT 

Definition at line 35 of file det44_in2out.c.

Function Documentation

◆ det44_icmp_in2out()

u32 det44_icmp_in2out ( 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 255 of file det44_in2out.c.

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

◆ det44_in2out_node()

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

Definition at line 402 of file det44_in2out.c.

+ Here is the call graph for this function:

◆ format_det44_in2out_trace()

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

Definition at line 72 of file det44_in2out.c.

◆ icmp_match_in2out_det()

u32 icmp_match_in2out_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_in2out.c.

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

Variable Documentation

◆ det44_in2out_error_strings

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

Definition at line 65 of file det44_in2out.c.

◆ det44_in2out_node

vlib_node_registration_t det44_in2out_node
Initial value:
= {
.name = "det44-in2out",
.vector_size = sizeof (u32),
.format_trace = format_det44_in2out_trace,
.error_strings = det44_in2out_error_strings,
.runtime_data_bytes = sizeof (det44_runtime_t),
.n_next_nodes = DET44_IN2OUT_N_NEXT,
.next_nodes = {
[DET44_IN2OUT_NEXT_DROP] = "error-drop",
[DET44_IN2OUT_NEXT_LOOKUP] = "ip4-lookup",
[DET44_IN2OUT_NEXT_ICMP_ERROR] = "ip4-icmp-error",
},
}

(constructor) VLIB_REGISTER_NODE (det44_in2out_node)

Definition at line 1015 of file det44_in2out.c.

det44_runtime_t
Definition: det44.h:77
DET44_IN2OUT_NEXT_DROP
@ DET44_IN2OUT_NEXT_DROP
Definition: det44_in2out.c:38
VLIB_NODE_TYPE_INTERNAL
@ VLIB_NODE_TYPE_INTERNAL
Definition: node.h:72
DET44_IN2OUT_NEXT_LOOKUP
@ DET44_IN2OUT_NEXT_LOOKUP
Definition: det44_in2out.c:37
format_det44_in2out_trace
static u8 * format_det44_in2out_trace(u8 *s, va_list *args)
Definition: det44_in2out.c:72
ARRAY_LEN
#define ARRAY_LEN(x)
Definition: clib.h:70
foreach_det44_in2out_error
#define foreach_det44_in2out_error
Definition: det44_in2out.c:50
det44_in2out_error_strings
static char * det44_in2out_error_strings[]
Definition: det44_in2out.c:65
u32
unsigned int u32
Definition: types.h:88
DET44_IN2OUT_N_NEXT
@ DET44_IN2OUT_N_NEXT
Definition: det44_in2out.c:40
DET44_IN2OUT_NEXT_ICMP_ERROR
@ DET44_IN2OUT_NEXT_ICMP_ERROR
Definition: det44_in2out.c:39
type
vl_api_fib_path_type_t type
Definition: fib_types.api:123