FD.io VPP  v19.08.1-401-g8e4ed521a
Vector Packet Processing
esp_encrypt.c File Reference
+ Include dependency graph for esp_encrypt.c:

Go to the source code of this file.

Data Structures

struct  esp_encrypt_trace_t
 
struct  esp_no_crypto_trace_t
 

Macros

#define foreach_esp_encrypt_next
 
#define foreach_esp_encrypt_error
 

Enumerations

enum  esp_encrypt_next_t { ESP_ENCRYPT_N_NEXT, ESP_ENCRYPT_N_NEXT }
 
enum  esp_encrypt_error_t { ESP_ENCRYPT_N_ERROR, ESP_ENCRYPT_N_ERROR }
 
enum  { ESP_NO_CRYPTO_NEXT_DROP, ESP_NO_CRYPTO_N_NEXT }
 
enum  { ESP_NO_CRYPTO_ERROR_RX_PKTS }
 

Functions

static u8format_esp_encrypt_trace (u8 *s, va_list *args)
 
static_always_inline u8esp_add_footer_and_icv (vlib_buffer_t *b, u8 block_size, u8 icv_sz, u16 *next, vlib_node_runtime_t *node, u16 buffer_data_size)
 
static_always_inline void esp_update_ip4_hdr (ip4_header_t *ip4, u16 len, int is_transport, int is_udp)
 
static_always_inline void esp_fill_udp_hdr (ipsec_sa_t *sa, udp_header_t *udp, u16 len)
 
static_always_inline u8 ext_hdr_is_pre_esp (u8 nexthdr)
 
static_always_inline u8 esp_get_ip6_hdr_len (ip6_header_t *ip6)
 
static_always_inline void esp_process_ops (vlib_main_t *vm, vlib_node_runtime_t *node, vnet_crypto_op_t *ops, vlib_buffer_t *b[], u16 *nexts)
 
 STATIC_ASSERT_SIZEOF (esp_gcm_nonce_t, 12)
 
static uword esp_encrypt_inline (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, int is_ip6, int is_tun)
 
VLIB_NODE_FN() esp4_encrypt_node (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
 
VLIB_NODE_FN() esp6_encrypt_node (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
 
VLIB_NODE_FN() esp4_encrypt_tun_node (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
 
 VNET_FEATURE_INIT (esp4_encrypt_tun_feat_node, static)
 
 VNET_FEATURE_INIT (esp6o4_encrypt_tun_feat_node, static)
 
 VNET_FEATURE_INIT (esp4_ethernet_encrypt_tun_feat_node, static)
 
VLIB_NODE_FN() esp6_encrypt_tun_node (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
 
 VNET_FEATURE_INIT (esp6_encrypt_tun_feat_node, static)
 
 VNET_FEATURE_INIT (esp4o6_encrypt_tun_feat_node, static)
 
static u8format_esp_no_crypto_trace (u8 *s, va_list *args)
 
static uword esp_no_crypto_inline (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 
VLIB_NODE_FN() esp4_no_crypto_tun_node (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
 
 VNET_FEATURE_INIT (esp4_no_crypto_tun_feat_node, static)
 
VLIB_NODE_FN() esp6_no_crypto_tun_node (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
 
 VNET_FEATURE_INIT (esp6_no_crypto_tun_feat_node, static)
 

Variables

static char * esp_encrypt_error_strings []
 
vlib_node_registration_t esp4_encrypt_node
 (constructor) VLIB_REGISTER_NODE (esp4_encrypt_node) More...
 
vlib_node_registration_t esp6_encrypt_node
 (constructor) VLIB_REGISTER_NODE (esp6_encrypt_node) More...
 
vlib_node_registration_t esp4_encrypt_tun_node
 (constructor) VLIB_REGISTER_NODE (esp4_encrypt_tun_node) More...
 
vlib_node_registration_t esp6_encrypt_tun_node
 (constructor) VLIB_REGISTER_NODE (esp6_encrypt_tun_node) More...
 
static char * esp_no_crypto_error_strings []
 
vlib_node_registration_t esp4_no_crypto_tun_node
 (constructor) VLIB_REGISTER_NODE (esp4_no_crypto_tun_node) More...
 
vlib_node_registration_t esp6_no_crypto_tun_node
 (constructor) VLIB_REGISTER_NODE (esp6_no_crypto_tun_node) More...
 

Macro Definition Documentation

◆ foreach_esp_encrypt_error

#define foreach_esp_encrypt_error
Value:
_(RX_PKTS, "ESP pkts received") \
_(SEQ_CYCLED, "sequence number cycled (packet dropped)") \
_(CRYPTO_ENGINE_ERROR, "crypto engine error (packet dropped)") \
_(CHAINED_BUFFER, "chained buffers (packet dropped)") \
_(NO_TRAILER_SPACE, "no trailer space (packet dropped)")

Definition at line 42 of file esp_encrypt.c.

◆ foreach_esp_encrypt_next

#define foreach_esp_encrypt_next
Value:
_(DROP, "error-drop") \
_(IP4_LOOKUP, "ip4-lookup") \
_(IP6_LOOKUP, "ip6-lookup") \
_(INTERFACE_OUTPUT, "interface-output")
DROP
Definition: error.def:41

Definition at line 28 of file esp_encrypt.c.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
ESP_NO_CRYPTO_NEXT_DROP 
ESP_NO_CRYPTO_N_NEXT 

Definition at line 702 of file esp_encrypt.c.

◆ anonymous enum

anonymous enum
Enumerator
ESP_NO_CRYPTO_ERROR_RX_PKTS 

Definition at line 708 of file esp_encrypt.c.

◆ esp_encrypt_error_t

Enumerator
ESP_ENCRYPT_N_ERROR 
ESP_ENCRYPT_N_ERROR 

Definition at line 49 of file esp_encrypt.c.

◆ esp_encrypt_next_t

Enumerator
ESP_ENCRYPT_N_NEXT 
ESP_ENCRYPT_N_NEXT 

Definition at line 35 of file esp_encrypt.c.

Function Documentation

◆ esp4_encrypt_node()

VLIB_NODE_FN() esp4_encrypt_node ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t from_frame 
)

Definition at line 549 of file esp_encrypt.c.

+ Here is the call graph for this function:

◆ esp4_encrypt_tun_node()

VLIB_NODE_FN() esp4_encrypt_tun_node ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t from_frame 
)

Definition at line 601 of file esp_encrypt.c.

+ Here is the call graph for this function:

◆ esp4_no_crypto_tun_node()

VLIB_NODE_FN() esp4_no_crypto_tun_node ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t from_frame 
)

Definition at line 759 of file esp_encrypt.c.

+ Here is the call graph for this function:

◆ esp6_encrypt_node()

VLIB_NODE_FN() esp6_encrypt_node ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t from_frame 
)

Definition at line 575 of file esp_encrypt.c.

+ Here is the call graph for this function:

◆ esp6_encrypt_tun_node()

VLIB_NODE_FN() esp6_encrypt_tun_node ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t from_frame 
)

Definition at line 646 of file esp_encrypt.c.

+ Here is the call graph for this function:

◆ esp6_no_crypto_tun_node()

VLIB_NODE_FN() esp6_no_crypto_tun_node ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t from_frame 
)

Definition at line 787 of file esp_encrypt.c.

+ Here is the call graph for this function:

◆ esp_add_footer_and_icv()

static_always_inline u8* esp_add_footer_and_icv ( vlib_buffer_t b,
u8  block_size,
u8  icv_sz,
u16 next,
vlib_node_runtime_t node,
u16  buffer_data_size 
)

Definition at line 94 of file esp_encrypt.c.

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

◆ esp_encrypt_inline()

static uword esp_encrypt_inline ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t frame,
int  is_ip6,
int  is_tun 
)
inlinestatic

Definition at line 236 of file esp_encrypt.c.

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

◆ esp_fill_udp_hdr()

static_always_inline void esp_fill_udp_hdr ( ipsec_sa_t sa,
udp_header_t udp,
u16  len 
)

Definition at line 151 of file esp_encrypt.c.

+ Here is the caller graph for this function:

◆ esp_get_ip6_hdr_len()

static_always_inline u8 esp_get_ip6_hdr_len ( ip6_header_t ip6)

Definition at line 176 of file esp_encrypt.c.

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

◆ esp_no_crypto_inline()

static uword esp_no_crypto_inline ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t frame 
)
inlinestatic

Definition at line 718 of file esp_encrypt.c.

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

◆ esp_process_ops()

static_always_inline void esp_process_ops ( vlib_main_t vm,
vlib_node_runtime_t node,
vnet_crypto_op_t ops,
vlib_buffer_t b[],
u16 nexts 
)

Definition at line 201 of file esp_encrypt.c.

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

◆ esp_update_ip4_hdr()

static_always_inline void esp_update_ip4_hdr ( ip4_header_t ip4,
u16  len,
int  is_transport,
int  is_udp 
)

Definition at line 125 of file esp_encrypt.c.

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

◆ ext_hdr_is_pre_esp()

static_always_inline u8 ext_hdr_is_pre_esp ( u8  nexthdr)

Definition at line 158 of file esp_encrypt.c.

+ Here is the caller graph for this function:

◆ format_esp_encrypt_trace()

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

Definition at line 76 of file esp_encrypt.c.

+ Here is the call graph for this function:

◆ format_esp_no_crypto_trace()

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

Definition at line 691 of file esp_encrypt.c.

+ Here is the call graph for this function:

◆ STATIC_ASSERT_SIZEOF()

STATIC_ASSERT_SIZEOF ( esp_gcm_nonce_t  ,
12   
)

◆ VNET_FEATURE_INIT() [1/7]

VNET_FEATURE_INIT ( esp4_encrypt_tun_feat_node  ,
static   
)

◆ VNET_FEATURE_INIT() [2/7]

VNET_FEATURE_INIT ( esp6o4_encrypt_tun_feat_node  ,
static   
)

◆ VNET_FEATURE_INIT() [3/7]

VNET_FEATURE_INIT ( esp4_ethernet_encrypt_tun_feat_node  ,
static   
)

◆ VNET_FEATURE_INIT() [4/7]

VNET_FEATURE_INIT ( esp6_encrypt_tun_feat_node  ,
static   
)

◆ VNET_FEATURE_INIT() [5/7]

VNET_FEATURE_INIT ( esp4o6_encrypt_tun_feat_node  ,
static   
)

◆ VNET_FEATURE_INIT() [6/7]

VNET_FEATURE_INIT ( esp4_no_crypto_tun_feat_node  ,
static   
)

◆ VNET_FEATURE_INIT() [7/7]

VNET_FEATURE_INIT ( esp6_no_crypto_tun_feat_node  ,
static   
)

Variable Documentation

◆ esp4_encrypt_node

vlib_node_registration_t esp4_encrypt_node
Initial value:
= {
.name = "esp4-encrypt",
.vector_size = sizeof (u32),
.format_trace = format_esp_encrypt_trace,
.error_strings = esp_encrypt_error_strings,
.n_next_nodes = ESP_ENCRYPT_N_NEXT,
.next_nodes = {
#define _(s,n)
},
}
static u8 * format_esp_encrypt_trace(u8 *s, va_list *args)
Definition: esp_encrypt.c:76
#define foreach_esp_encrypt_next
Definition: esp_encrypt.c:28
unsigned int u32
Definition: types.h:88
vl_api_fib_path_type_t type
Definition: fib_types.api:123
static char * esp_encrypt_error_strings[]
Definition: esp_encrypt.c:57
#define ARRAY_LEN(x)
Definition: clib.h:62

(constructor) VLIB_REGISTER_NODE (esp4_encrypt_node)

Definition at line 557 of file esp_encrypt.c.

◆ esp4_encrypt_tun_node

vlib_node_registration_t esp4_encrypt_tun_node
Initial value:
= {
.name = "esp4-encrypt-tun",
.vector_size = sizeof (u32),
.format_trace = format_esp_encrypt_trace,
.error_strings = esp_encrypt_error_strings,
.n_next_nodes = 1,
.next_nodes = {
[ESP_ENCRYPT_NEXT_DROP] = "ip4-drop",
},
}
static u8 * format_esp_encrypt_trace(u8 *s, va_list *args)
Definition: esp_encrypt.c:76
unsigned int u32
Definition: types.h:88
vl_api_fib_path_type_t type
Definition: fib_types.api:123
static char * esp_encrypt_error_strings[]
Definition: esp_encrypt.c:57
#define ARRAY_LEN(x)
Definition: clib.h:62

(constructor) VLIB_REGISTER_NODE (esp4_encrypt_tun_node)

Definition at line 609 of file esp_encrypt.c.

◆ esp4_no_crypto_tun_node

vlib_node_registration_t esp4_no_crypto_tun_node
Initial value:
=
{
.name = "esp4-no-crypto",
.vector_size = sizeof (u32),
.format_trace = format_esp_no_crypto_trace,
.error_strings = esp_no_crypto_error_strings,
.n_next_nodes = ESP_NO_CRYPTO_N_NEXT,
.next_nodes = {
[ESP_NO_CRYPTO_NEXT_DROP] = "ip4-drop",
},
}
static char * esp_no_crypto_error_strings[]
Definition: esp_encrypt.c:713
unsigned int u32
Definition: types.h:88
static u8 * format_esp_no_crypto_trace(u8 *s, va_list *args)
Definition: esp_encrypt.c:691
#define ARRAY_LEN(x)
Definition: clib.h:62

(constructor) VLIB_REGISTER_NODE (esp4_no_crypto_tun_node)

Definition at line 767 of file esp_encrypt.c.

◆ esp6_encrypt_node

vlib_node_registration_t esp6_encrypt_node
Initial value:
= {
.name = "esp6-encrypt",
.vector_size = sizeof (u32),
.format_trace = format_esp_encrypt_trace,
.error_strings = esp_encrypt_error_strings,
.n_next_nodes = ESP_ENCRYPT_N_NEXT,
.next_nodes = {
#define _(s,n)
},
}
static u8 * format_esp_encrypt_trace(u8 *s, va_list *args)
Definition: esp_encrypt.c:76
#define foreach_esp_encrypt_next
Definition: esp_encrypt.c:28
unsigned int u32
Definition: types.h:88
vl_api_fib_path_type_t type
Definition: fib_types.api:123
static char * esp_encrypt_error_strings[]
Definition: esp_encrypt.c:57
#define ARRAY_LEN(x)
Definition: clib.h:62

(constructor) VLIB_REGISTER_NODE (esp6_encrypt_node)

Definition at line 583 of file esp_encrypt.c.

◆ esp6_encrypt_tun_node

vlib_node_registration_t esp6_encrypt_tun_node
Initial value:
= {
.name = "esp6-encrypt-tun",
.vector_size = sizeof (u32),
.format_trace = format_esp_encrypt_trace,
.error_strings = esp_encrypt_error_strings,
.n_next_nodes = 1,
.next_nodes = {
[ESP_ENCRYPT_NEXT_DROP] = "ip6-drop",
},
}
static u8 * format_esp_encrypt_trace(u8 *s, va_list *args)
Definition: esp_encrypt.c:76
unsigned int u32
Definition: types.h:88
vl_api_fib_path_type_t type
Definition: fib_types.api:123
static char * esp_encrypt_error_strings[]
Definition: esp_encrypt.c:57
#define ARRAY_LEN(x)
Definition: clib.h:62

(constructor) VLIB_REGISTER_NODE (esp6_encrypt_tun_node)

Definition at line 654 of file esp_encrypt.c.

◆ esp6_no_crypto_tun_node

vlib_node_registration_t esp6_no_crypto_tun_node
Initial value:
=
{
.name = "esp6-no-crypto",
.vector_size = sizeof (u32),
.format_trace = format_esp_no_crypto_trace,
.error_strings = esp_no_crypto_error_strings,
.n_next_nodes = ESP_NO_CRYPTO_N_NEXT,
.next_nodes = {
[ESP_NO_CRYPTO_NEXT_DROP] = "ip6-drop",
},
}
static char * esp_no_crypto_error_strings[]
Definition: esp_encrypt.c:713
unsigned int u32
Definition: types.h:88
static u8 * format_esp_no_crypto_trace(u8 *s, va_list *args)
Definition: esp_encrypt.c:691
#define ARRAY_LEN(x)
Definition: clib.h:62

(constructor) VLIB_REGISTER_NODE (esp6_no_crypto_tun_node)

Definition at line 795 of file esp_encrypt.c.

◆ esp_encrypt_error_strings

char* esp_encrypt_error_strings[]
static
Initial value:
= {
#define _(sym,string)
}
#define foreach_esp_encrypt_error
Definition: esp_encrypt.c:42

Definition at line 57 of file esp_encrypt.c.

◆ esp_no_crypto_error_strings

char* esp_no_crypto_error_strings[]
static
Initial value:
= {
"Outbound ESP packets received",
}

Definition at line 713 of file esp_encrypt.c.