FD.io VPP  v21.10.1-2-g0a485f517
Vector Packet Processing
nat64_in2out.c File Reference
+ Include dependency graph for nat64_in2out.c:

Go to the source code of this file.

Data Structures

struct  nat64_in2out_trace_t
 
struct  nat64_in2out_set_ctx_t_
 
struct  unk_proto_st_walk_ctx_t_
 
struct  nat64_in2out_frag_set_ctx_t_
 
struct  nat64_in2out_handoff_trace_t
 

Macros

#define foreach_nat64_in2out_error
 
#define foreach_nat64_in2out_handoff_error
 

Typedefs

typedef struct nat64_in2out_set_ctx_t_ nat64_in2out_set_ctx_t
 
typedef struct unk_proto_st_walk_ctx_t_ unk_proto_st_walk_ctx_t
 
typedef struct nat64_in2out_frag_set_ctx_t_ nat64_in2out_frag_set_ctx_t
 

Enumerations

enum  nat64_in2out_error_t { NAT64_IN2OUT_N_ERROR }
 
enum  nat64_in2out_next_t {
  NAT64_IN2OUT_NEXT_IP4_LOOKUP, NAT64_IN2OUT_NEXT_IP6_LOOKUP, NAT64_IN2OUT_NEXT_DROP, NAT64_IN2OUT_NEXT_SLOWPATH,
  NAT64_IN2OUT_N_NEXT
}
 
enum  nat64_in2out_handoff_error_t { NAT64_IN2OUT_HANDOFF_N_ERROR }
 

Functions

static u8format_nat64_in2out_trace (u8 *s, va_list *args)
 
static u8 nat64_not_translate (u32 sw_if_index, ip6_address_t ip6_addr)
 
static_always_inline int is_hairpinning (ip6_address_t *dst_addr)
 Check whether is a hairpinning. More...
 
static int nat64_in2out_tcp_udp (vlib_main_t *vm, vlib_buffer_t *p, u16 l4_offset, u16 frag_hdr_offset, nat64_in2out_set_ctx_t *ctx)
 
static int nat64_in2out_icmp_set_cb (ip6_header_t *ip6, ip4_header_t *ip4, void *arg)
 
static int nat64_in2out_inner_icmp_set_cb (ip6_header_t *ip6, ip4_header_t *ip4, void *arg)
 
static int unk_proto_st_walk (nat64_db_st_entry_t *ste, void *arg)
 
static int nat64_in2out_unk_proto (vlib_main_t *vm, vlib_buffer_t *p, u8 l4_protocol, u16 l4_offset, u16 frag_hdr_offset, nat64_in2out_set_ctx_t *s_ctx)
 
static int nat64_in2out_tcp_udp_hairpinning (vlib_main_t *vm, vlib_buffer_t *b, ip6_header_t *ip6, u32 l4_offset, u32 thread_index)
 
static int nat64_in2out_icmp_hairpinning (vlib_main_t *vm, vlib_buffer_t *b, ip6_header_t *ip6, u32 thread_index)
 
static int nat64_in2out_unk_proto_hairpinning (vlib_main_t *vm, vlib_buffer_t *b, ip6_header_t *ip6, u32 thread_index)
 
static uword nat64_in2out_node_fn_inline (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, u8 is_slow_path)
 
VLIB_NODE_FN() nat64_in2out_node (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 
VLIB_NODE_FN() nat64_in2out_slowpath_node (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 
static u8format_nat64_in2out_handoff_trace (u8 *s, va_list *args)
 
VLIB_NODE_FN() nat64_in2out_handoff_node (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 

Variables

static char * nat64_in2out_error_strings []
 
vlib_node_registration_t nat64_in2out_node
 (constructor) VLIB_REGISTER_NODE (nat64_in2out_node) More...
 
vlib_node_registration_t nat64_in2out_slowpath_node
 (constructor) VLIB_REGISTER_NODE (nat64_in2out_slowpath_node) More...
 
static char * nat64_in2out_handoff_error_strings []
 
vlib_node_registration_t nat64_in2out_handoff_node
 (constructor) VLIB_REGISTER_NODE (nat64_in2out_handoff_node) More...
 

Macro Definition Documentation

◆ foreach_nat64_in2out_error

#define foreach_nat64_in2out_error
Value:
_(UNSUPPORTED_PROTOCOL, "unsupported protocol") \
_(NO_TRANSLATION, "no translation") \
_(UNKNOWN, "unknown")

Definition at line 45 of file nat64_in2out.c.

◆ foreach_nat64_in2out_handoff_error

#define foreach_nat64_in2out_handoff_error
Value:
_(CONGESTION_DROP, "congestion drop") \
_(SAME_WORKER, "same worker") \
_(DO_HANDOFF, "do handoff")

Definition at line 1285 of file nat64_in2out.c.

Typedef Documentation

◆ nat64_in2out_frag_set_ctx_t

◆ nat64_in2out_set_ctx_t

◆ unk_proto_st_walk_ctx_t

Enumeration Type Documentation

◆ nat64_in2out_error_t

Enumerator
NAT64_IN2OUT_N_ERROR 

Definition at line 51 of file nat64_in2out.c.

◆ nat64_in2out_handoff_error_t

Enumerator
NAT64_IN2OUT_HANDOFF_N_ERROR 

Definition at line 1290 of file nat64_in2out.c.

◆ nat64_in2out_next_t

Enumerator
NAT64_IN2OUT_NEXT_IP4_LOOKUP 
NAT64_IN2OUT_NEXT_IP6_LOOKUP 
NAT64_IN2OUT_NEXT_DROP 
NAT64_IN2OUT_NEXT_SLOWPATH 
NAT64_IN2OUT_N_NEXT 

Definition at line 65 of file nat64_in2out.c.

Function Documentation

◆ format_nat64_in2out_handoff_trace()

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

Definition at line 1310 of file nat64_in2out.c.

◆ format_nat64_in2out_trace()

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

Definition at line 29 of file nat64_in2out.c.

◆ is_hairpinning()

static_always_inline int is_hairpinning ( ip6_address_t *  dst_addr)

Check whether is a hairpinning.

If the destination IP address of the packet is an IPv4 address assigned to the NAT64 itself, then the packet is a hairpin packet.

param dst_addr Destination address of the packet.

Returns
1 if hairpinning, otherwise 0.

Definition at line 112 of file nat64_in2out.c.

+ Here is the caller graph for this function:

◆ nat64_in2out_handoff_node()

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

Definition at line 1323 of file nat64_in2out.c.

+ Here is the call graph for this function:

◆ nat64_in2out_icmp_hairpinning()

static int nat64_in2out_icmp_hairpinning ( vlib_main_t vm,
vlib_buffer_t b,
ip6_header_t ip6,
u32  thread_index 
)
static

Definition at line 781 of file nat64_in2out.c.

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

◆ nat64_in2out_icmp_set_cb()

static int nat64_in2out_icmp_set_cb ( ip6_header_t ip6,
ip4_header_t ip4,
void *  arg 
)
static

Definition at line 279 of file nat64_in2out.c.

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

◆ nat64_in2out_inner_icmp_set_cb()

static int nat64_in2out_inner_icmp_set_cb ( ip6_header_t ip6,
ip4_header_t ip4,
void *  arg 
)
static

Definition at line 372 of file nat64_in2out.c.

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

◆ nat64_in2out_node()

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

Definition at line 1222 of file nat64_in2out.c.

+ Here is the call graph for this function:

◆ nat64_in2out_node_fn_inline()

static uword nat64_in2out_node_fn_inline ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t frame,
u8  is_slow_path 
)
inlinestatic

Definition at line 1029 of file nat64_in2out.c.

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

◆ nat64_in2out_slowpath_node()

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

Definition at line 1248 of file nat64_in2out.c.

+ Here is the call graph for this function:

◆ nat64_in2out_tcp_udp()

static int nat64_in2out_tcp_udp ( vlib_main_t vm,
vlib_buffer_t p,
u16  l4_offset,
u16  frag_hdr_offset,
nat64_in2out_set_ctx_t ctx 
)
static

Definition at line 127 of file nat64_in2out.c.

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

◆ nat64_in2out_tcp_udp_hairpinning()

static int nat64_in2out_tcp_udp_hairpinning ( vlib_main_t vm,
vlib_buffer_t b,
ip6_header_t ip6,
u32  l4_offset,
u32  thread_index 
)
static

Definition at line 647 of file nat64_in2out.c.

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

◆ nat64_in2out_unk_proto()

static int nat64_in2out_unk_proto ( vlib_main_t vm,
vlib_buffer_t p,
u8  l4_protocol,
u16  l4_offset,
u16  frag_hdr_offset,
nat64_in2out_set_ctx_t s_ctx 
)
static

Definition at line 500 of file nat64_in2out.c.

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

◆ nat64_in2out_unk_proto_hairpinning()

static int nat64_in2out_unk_proto_hairpinning ( vlib_main_t vm,
vlib_buffer_t b,
ip6_header_t ip6,
u32  thread_index 
)
static

Definition at line 907 of file nat64_in2out.c.

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

◆ nat64_not_translate()

static u8 nat64_not_translate ( u32  sw_if_index,
ip6_address_t  ip6_addr 
)
inlinestatic

Definition at line 82 of file nat64_in2out.c.

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

◆ unk_proto_st_walk()

static int unk_proto_st_walk ( nat64_db_st_entry_t *  ste,
void *  arg 
)
static

Definition at line 465 of file nat64_in2out.c.

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

Variable Documentation

◆ nat64_in2out_error_strings

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

Definition at line 59 of file nat64_in2out.c.

◆ nat64_in2out_handoff_error_strings

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

Definition at line 1298 of file nat64_in2out.c.

◆ nat64_in2out_handoff_node

vlib_node_registration_t nat64_in2out_handoff_node
Initial value:
= {
.name = "nat64-in2out-handoff",
.vector_size = sizeof (u32),
.n_next_nodes = 1,
.next_nodes = {
[0] = "error-drop",
},
}

(constructor) VLIB_REGISTER_NODE (nat64_in2out_handoff_node)

Definition at line 1388 of file nat64_in2out.c.

◆ nat64_in2out_node

vlib_node_registration_t nat64_in2out_node
Initial value:
= {
.name = "nat64-in2out",
.vector_size = sizeof (u32),
.format_trace = format_nat64_in2out_trace,
.error_strings = nat64_in2out_error_strings,
.n_next_nodes = NAT64_IN2OUT_N_NEXT,
.next_nodes = {
[NAT64_IN2OUT_NEXT_DROP] = "error-drop",
[NAT64_IN2OUT_NEXT_IP4_LOOKUP] = "ip4-lookup",
[NAT64_IN2OUT_NEXT_IP6_LOOKUP] = "ip6-lookup",
[NAT64_IN2OUT_NEXT_SLOWPATH] = "nat64-in2out-slowpath",
},
}

(constructor) VLIB_REGISTER_NODE (nat64_in2out_node)

Definition at line 1230 of file nat64_in2out.c.

◆ nat64_in2out_slowpath_node

vlib_node_registration_t nat64_in2out_slowpath_node
Initial value:
= {
.name = "nat64-in2out-slowpath",
.vector_size = sizeof (u32),
.format_trace = format_nat64_in2out_trace,
.error_strings = nat64_in2out_error_strings,
.n_next_nodes = NAT64_IN2OUT_N_NEXT,
.next_nodes = {
[NAT64_IN2OUT_NEXT_DROP] = "error-drop",
[NAT64_IN2OUT_NEXT_IP4_LOOKUP] = "ip4-lookup",
[NAT64_IN2OUT_NEXT_IP6_LOOKUP] = "ip6-lookup",
[NAT64_IN2OUT_NEXT_SLOWPATH] = "nat64-in2out-slowpath",
},
}

(constructor) VLIB_REGISTER_NODE (nat64_in2out_slowpath_node)

Definition at line 1256 of file nat64_in2out.c.

NAT64_IN2OUT_NEXT_SLOWPATH
@ NAT64_IN2OUT_NEXT_SLOWPATH
Definition: nat64_in2out.c:70
VLIB_NODE_TYPE_INTERNAL
@ VLIB_NODE_TYPE_INTERNAL
Definition: node.h:72
nat64_in2out_handoff_error_strings
static char * nat64_in2out_handoff_error_strings[]
Definition: nat64_in2out.c:1298
NAT64_IN2OUT_NEXT_IP6_LOOKUP
@ NAT64_IN2OUT_NEXT_IP6_LOOKUP
Definition: nat64_in2out.c:68
format_nat64_in2out_handoff_trace
static u8 * format_nat64_in2out_handoff_trace(u8 *s, va_list *args)
Definition: nat64_in2out.c:1310
format_nat64_in2out_trace
static u8 * format_nat64_in2out_trace(u8 *s, va_list *args)
Definition: nat64_in2out.c:29
ARRAY_LEN
#define ARRAY_LEN(x)
Definition: clib.h:70
u32
unsigned int u32
Definition: types.h:88
foreach_nat64_in2out_handoff_error
#define foreach_nat64_in2out_handoff_error
Definition: nat64_in2out.c:1285
foreach_nat64_in2out_error
#define foreach_nat64_in2out_error
Definition: nat64_in2out.c:45
NAT64_IN2OUT_NEXT_DROP
@ NAT64_IN2OUT_NEXT_DROP
Definition: nat64_in2out.c:69
nat64_in2out_error_strings
static char * nat64_in2out_error_strings[]
Definition: nat64_in2out.c:59
NAT64_IN2OUT_NEXT_IP4_LOOKUP
@ NAT64_IN2OUT_NEXT_IP4_LOOKUP
Definition: nat64_in2out.c:67
NAT64_IN2OUT_N_NEXT
@ NAT64_IN2OUT_N_NEXT
Definition: nat64_in2out.c:71
type
vl_api_fib_path_type_t type
Definition: fib_types.api:123