FD.io VPP  v21.10.1-2-g0a485f517
Vector Packet Processing
cnat_node.h File Reference
+ Include dependency graph for cnat_node.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  cnat_trace_element_t_
 

Typedefs

typedef uword(* cnat_node_sub_t) (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_buffer_t *b, cnat_node_ctx_t *ctx, int rv, cnat_session_t *session)
 
typedef struct cnat_trace_element_t_ cnat_trace_element_t
 
typedef enum cnat_trace_element_flag_t_ cnat_trace_element_flag_t
 

Enumerations

enum  cnat_trace_element_flag_t_ { CNAT_TRACE_SESSION_FOUND = (1 << 0), CNAT_TRACE_SESSION_CREATED = (1 << 1), CNAT_TRACE_TRANSLATION_FOUND = (1 << 2), CNAT_TRACE_NO_NAT = (1 << 3) }
 

Functions

static_always_inline void cnat_add_trace (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_buffer_t *b, cnat_session_t *session, const cnat_translation_t *ct, u8 flags)
 
static u8format_cnat_trace (u8 *s, va_list *args)
 
static_always_inline u8 icmp_type_is_error_message (u8 icmp_type)
 
static_always_inline u8 icmp_type_is_echo (u8 icmp_type)
 
static_always_inline u8 icmp6_type_is_echo (u8 icmp_type)
 
static_always_inline u8 icmp6_type_is_error_message (u8 icmp_type)
 
static_always_inline u8 cmp_ip6_address (const ip6_address_t *a1, const ip6_address_t *a2)
 
static_always_inline u8 has_ip6_address (ip6_address_t *a)
 Inline translation functions. More...
 
static_always_inline void cnat_ip4_translate_l4 (ip4_header_t *ip4, udp_header_t *udp, ip_csum_t *sum, ip4_address_t new_addr[VLIB_N_DIR], u16 new_port[VLIB_N_DIR])
 
static_always_inline void cnat_ip4_translate_l3 (ip4_header_t *ip4, ip4_address_t new_addr[VLIB_N_DIR])
 
static_always_inline void cnat_tcp_update_session_lifetime (tcp_header_t *tcp, u32 index)
 
static_always_inline void cnat_translation_icmp4_echo (ip4_header_t *ip4, icmp46_header_t *icmp, ip4_address_t new_addr[VLIB_N_DIR], u16 new_port[VLIB_N_DIR])
 
static_always_inline void cnat_translation_icmp4_error (ip4_header_t *outer_ip4, icmp46_header_t *icmp, ip4_address_t outer_new_addr[VLIB_N_DIR], u16 outer_new_port[VLIB_N_DIR], u8 snat_outer_ip)
 
static_always_inline void cnat_translation_ip4 (const cnat_session_t *session, ip4_header_t *ip4, udp_header_t *udp)
 
static_always_inline void cnat_ip6_translate_l3 (ip6_header_t *ip6, ip6_address_t new_addr[VLIB_N_DIR])
 
static_always_inline void cnat_ip6_translate_l4 (ip6_header_t *ip6, udp_header_t *udp, ip_csum_t *sum, ip6_address_t new_addr[VLIB_N_DIR], u16 new_port[VLIB_N_DIR])
 
static_always_inline void cnat_translation_icmp6_echo (ip6_header_t *ip6, icmp46_header_t *icmp, ip6_address_t new_addr[VLIB_N_DIR], u16 new_port[VLIB_N_DIR])
 
static_always_inline void cnat_translation_icmp6_error (ip6_header_t *outer_ip6, icmp46_header_t *icmp, ip6_address_t outer_new_addr[VLIB_N_DIR], u16 outer_new_port[VLIB_N_DIR], u8 snat_outer_ip)
 
static_always_inline void cnat_translation_ip6 (const cnat_session_t *session, ip6_header_t *ip6, udp_header_t *udp)
 
static_always_inline void cnat_session_make_key (vlib_buffer_t *b, ip_address_family_t af, cnat_session_location_t cs_loc, cnat_bihash_kv_t *bkey)
 
static_always_inline cnat_ep_trk_tcnat_load_balance (const cnat_translation_t *ct, ip_address_family_t af, ip4_header_t *ip4, ip6_header_t *ip6, u32 *dpoi_index)
 
static_always_inline void cnat_session_create (cnat_session_t *session, cnat_node_ctx_t *ctx, cnat_session_location_t rsession_location, u8 rsession_flags)
 Create NAT sessions rsession_location is the location the (return) session will be matched at. More...
 
static uword cnat_node_inline (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, cnat_node_sub_t cnat_sub, ip_address_family_t af, cnat_session_location_t cs_loc, u8 do_trace)
 

Typedef Documentation

◆ cnat_node_sub_t

typedef uword(* cnat_node_sub_t) (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_buffer_t *b, cnat_node_ctx_t *ctx, int rv, cnat_session_t *session)

Definition at line 31 of file cnat_node.h.

◆ cnat_trace_element_flag_t

◆ cnat_trace_element_t

Enumeration Type Documentation

◆ cnat_trace_element_flag_t_

Enumerator
CNAT_TRACE_SESSION_FOUND 
CNAT_TRACE_SESSION_CREATED 
CNAT_TRACE_TRANSLATION_FOUND 
CNAT_TRACE_NO_NAT 

Definition at line 46 of file cnat_node.h.

Function Documentation

◆ cmp_ip6_address()

static_always_inline u8 cmp_ip6_address ( const ip6_address_t *  a1,
const ip6_address_t *  a2 
)

Definition at line 162 of file cnat_node.h.

+ Here is the caller graph for this function:

◆ cnat_add_trace()

static_always_inline void cnat_add_trace ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_buffer_t b,
cnat_session_t session,
const cnat_translation_t ct,
u8  flags 
)

Definition at line 55 of file cnat_node.h.

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

◆ cnat_ip4_translate_l3()

static_always_inline void cnat_ip4_translate_l3 ( ip4_header_t ip4,
ip4_address_t  new_addr[VLIB_N_DIR] 
)

Definition at line 229 of file cnat_node.h.

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

◆ cnat_ip4_translate_l4()

static_always_inline void cnat_ip4_translate_l4 ( ip4_header_t ip4,
udp_header_t udp,
ip_csum_t sum,
ip4_address_t  new_addr[VLIB_N_DIR],
u16  new_port[VLIB_N_DIR] 
)

Definition at line 179 of file cnat_node.h.

+ Here is the caller graph for this function:

◆ cnat_ip6_translate_l3()

static_always_inline void cnat_ip6_translate_l3 ( ip6_header_t ip6,
ip6_address_t  new_addr[VLIB_N_DIR] 
)

Definition at line 428 of file cnat_node.h.

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

◆ cnat_ip6_translate_l4()

static_always_inline void cnat_ip6_translate_l4 ( ip6_header_t ip6,
udp_header_t udp,
ip_csum_t sum,
ip6_address_t  new_addr[VLIB_N_DIR],
u16  new_port[VLIB_N_DIR] 
)

Definition at line 437 of file cnat_node.h.

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

◆ cnat_load_balance()

static_always_inline cnat_ep_trk_t* cnat_load_balance ( const cnat_translation_t ct,
ip_address_family_t  af,
ip4_header_t ip4,
ip6_header_t ip6,
u32 dpoi_index 
)

Definition at line 807 of file cnat_node.h.

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

◆ cnat_node_inline()

static uword cnat_node_inline ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t frame,
cnat_node_sub_t  cnat_sub,
ip_address_family_t  af,
cnat_session_location_t  cs_loc,
u8  do_trace 
)
inlinestatic

Definition at line 933 of file cnat_node.h.

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

◆ cnat_session_create()

static_always_inline void cnat_session_create ( cnat_session_t session,
cnat_node_ctx_t ctx,
cnat_session_location_t  rsession_location,
u8  rsession_flags 
)

Create NAT sessions rsession_location is the location the (return) session will be matched at.

Definition at line 841 of file cnat_node.h.

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

◆ cnat_session_make_key()

static_always_inline void cnat_session_make_key ( vlib_buffer_t b,
ip_address_family_t  af,
cnat_session_location_t  cs_loc,
cnat_bihash_kv_t bkey 
)

Definition at line 685 of file cnat_node.h.

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

◆ cnat_tcp_update_session_lifetime()

static_always_inline void cnat_tcp_update_session_lifetime ( tcp_header_t tcp,
u32  index 
)

Definition at line 256 of file cnat_node.h.

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

◆ cnat_translation_icmp4_echo()

static_always_inline void cnat_translation_icmp4_echo ( ip4_header_t ip4,
icmp46_header_t *  icmp,
ip4_address_t  new_addr[VLIB_N_DIR],
u16  new_port[VLIB_N_DIR] 
)

Definition at line 276 of file cnat_node.h.

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

◆ cnat_translation_icmp4_error()

static_always_inline void cnat_translation_icmp4_error ( ip4_header_t outer_ip4,
icmp46_header_t *  icmp,
ip4_address_t  outer_new_addr[VLIB_N_DIR],
u16  outer_new_port[VLIB_N_DIR],
u8  snat_outer_ip 
)

Definition at line 297 of file cnat_node.h.

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

◆ cnat_translation_icmp6_echo()

static_always_inline void cnat_translation_icmp6_echo ( ip6_header_t ip6,
icmp46_header_t *  icmp,
ip6_address_t  new_addr[VLIB_N_DIR],
u16  new_port[VLIB_N_DIR] 
)

Definition at line 491 of file cnat_node.h.

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

◆ cnat_translation_icmp6_error()

static_always_inline void cnat_translation_icmp6_error ( ip6_header_t outer_ip6,
icmp46_header_t *  icmp,
ip6_address_t  outer_new_addr[VLIB_N_DIR],
u16  outer_new_port[VLIB_N_DIR],
u8  snat_outer_ip 
)

Definition at line 531 of file cnat_node.h.

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

◆ cnat_translation_ip4()

static_always_inline void cnat_translation_ip4 ( const cnat_session_t session,
ip4_header_t ip4,
udp_header_t udp 
)

Definition at line 383 of file cnat_node.h.

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

◆ cnat_translation_ip6()

static_always_inline void cnat_translation_ip6 ( const cnat_session_t session,
ip6_header_t ip6,
udp_header_t udp 
)

Definition at line 640 of file cnat_node.h.

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

◆ format_cnat_trace()

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

Definition at line 75 of file cnat_node.h.

+ Here is the call graph for this function:

◆ has_ip6_address()

static_always_inline u8 has_ip6_address ( ip6_address_t *  a)

Inline translation functions.

Definition at line 173 of file cnat_node.h.

+ Here is the caller graph for this function:

◆ icmp6_type_is_echo()

static_always_inline u8 icmp6_type_is_echo ( u8  icmp_type)

Definition at line 137 of file cnat_node.h.

+ Here is the caller graph for this function:

◆ icmp6_type_is_error_message()

static_always_inline u8 icmp6_type_is_error_message ( u8  icmp_type)

Definition at line 149 of file cnat_node.h.

+ Here is the caller graph for this function:

◆ icmp_type_is_echo()

static_always_inline u8 icmp_type_is_echo ( u8  icmp_type)

Definition at line 125 of file cnat_node.h.

+ Here is the caller graph for this function:

◆ icmp_type_is_error_message()

static_always_inline u8 icmp_type_is_error_message ( u8  icmp_type)

Definition at line 109 of file cnat_node.h.

+ Here is the caller graph for this function: