35 if (sa->
integ_alg == IPSEC_INTEG_ALG_NONE)
50 if (IPSEC_INTEG_ALG_NONE != sa->
integ_alg)
113 const char *prev_node_name,
u32 * out_node_index,
114 u32 * out_next_index)
121 *out_node_index = node->
index;
127 const char *node_name,
u32 * out_feature_index)
139 const char *ah4_encrypt_node_name,
140 const char *ah4_decrypt_node_name,
141 const char *ah6_encrypt_node_name,
142 const char *ah6_decrypt_node_name,
150 ipsec_add_node (vm, ah4_encrypt_node_name,
"ipsec4-output-feature",
152 ipsec_add_node (vm, ah4_decrypt_node_name,
"ipsec4-input-feature",
154 ipsec_add_node (vm, ah6_encrypt_node_name,
"ipsec6-output-feature",
156 ipsec_add_node (vm, ah6_decrypt_node_name,
"ipsec6-input-feature",
167 const char *esp4_encrypt_node_name,
168 const char *esp4_encrypt_node_tun_name,
169 const char *esp4_decrypt_node_name,
170 const char *esp6_encrypt_node_name,
171 const char *esp6_encrypt_node_tun_name,
172 const char *esp6_decrypt_node_name,
181 ipsec_add_node (vm, esp4_encrypt_node_name,
"ipsec4-output-feature",
183 ipsec_add_node (vm, esp4_decrypt_node_name,
"ipsec4-input-feature",
185 ipsec_add_node (vm, esp6_encrypt_node_name,
"ipsec6-output-feature",
187 ipsec_add_node (vm, esp6_decrypt_node_name,
"ipsec6-input-feature",
206 "%d SA entries configured",
211 "%d tunnel-interface entries configured",
221 return VNET_API_ERROR_RSRC_IN_USE;
224 return VNET_API_ERROR_INVALID_VALUE;
244 return VNET_API_ERROR_RSRC_IN_USE;
247 return VNET_API_ERROR_INVALID_VALUE;
331 a->
enc_op_id = VNET_CRYPTO_OP_DES_CBC_ENC;
332 a->
dec_op_id = VNET_CRYPTO_OP_DES_CBC_DEC;
333 a->
alg = VNET_CRYPTO_ALG_DES_CBC;
337 a->
enc_op_id = VNET_CRYPTO_OP_3DES_CBC_ENC;
338 a->
dec_op_id = VNET_CRYPTO_OP_3DES_CBC_DEC;
339 a->
alg = VNET_CRYPTO_ALG_3DES_CBC;
342 a = im->
crypto_algs + IPSEC_CRYPTO_ALG_AES_CBC_128;
343 a->
enc_op_id = VNET_CRYPTO_OP_AES_128_CBC_ENC;
344 a->
dec_op_id = VNET_CRYPTO_OP_AES_128_CBC_DEC;
345 a->
alg = VNET_CRYPTO_ALG_AES_128_CBC;
348 a = im->
crypto_algs + IPSEC_CRYPTO_ALG_AES_CBC_192;
349 a->
enc_op_id = VNET_CRYPTO_OP_AES_192_CBC_ENC;
350 a->
dec_op_id = VNET_CRYPTO_OP_AES_192_CBC_DEC;
351 a->
alg = VNET_CRYPTO_ALG_AES_192_CBC;
354 a = im->
crypto_algs + IPSEC_CRYPTO_ALG_AES_CBC_256;
355 a->
enc_op_id = VNET_CRYPTO_OP_AES_256_CBC_ENC;
356 a->
dec_op_id = VNET_CRYPTO_OP_AES_256_CBC_DEC;
357 a->
alg = VNET_CRYPTO_ALG_AES_256_CBC;
360 a = im->
crypto_algs + IPSEC_CRYPTO_ALG_AES_GCM_128;
361 a->
enc_op_id = VNET_CRYPTO_OP_AES_128_GCM_ENC;
362 a->
dec_op_id = VNET_CRYPTO_OP_AES_128_GCM_DEC;
363 a->
alg = VNET_CRYPTO_ALG_AES_128_GCM;
368 a = im->
crypto_algs + IPSEC_CRYPTO_ALG_AES_GCM_192;
369 a->
enc_op_id = VNET_CRYPTO_OP_AES_192_GCM_ENC;
370 a->
dec_op_id = VNET_CRYPTO_OP_AES_192_GCM_DEC;
371 a->
alg = VNET_CRYPTO_ALG_AES_192_GCM;
376 a = im->
crypto_algs + IPSEC_CRYPTO_ALG_AES_GCM_256;
377 a->
enc_op_id = VNET_CRYPTO_OP_AES_256_GCM_ENC;
378 a->
dec_op_id = VNET_CRYPTO_OP_AES_256_GCM_DEC;
379 a->
alg = VNET_CRYPTO_ALG_AES_256_GCM;
388 i->
op_id = VNET_CRYPTO_OP_MD5_HMAC;
389 i->
alg = VNET_CRYPTO_ALG_HMAC_MD5;
393 i->
op_id = VNET_CRYPTO_OP_SHA1_HMAC;
394 i->
alg = VNET_CRYPTO_ALG_HMAC_SHA1;
397 i = &im->
integ_algs[IPSEC_INTEG_ALG_SHA_256_96];
398 i->
op_id = VNET_CRYPTO_OP_SHA1_HMAC;
399 i->
alg = VNET_CRYPTO_ALG_HMAC_SHA256;
402 i = &im->
integ_algs[IPSEC_INTEG_ALG_SHA_256_128];
403 i->
op_id = VNET_CRYPTO_OP_SHA256_HMAC;
404 i->
alg = VNET_CRYPTO_ALG_HMAC_SHA256;
407 i = &im->
integ_algs[IPSEC_INTEG_ALG_SHA_384_192];
408 i->
op_id = VNET_CRYPTO_OP_SHA384_HMAC;
409 i->
alg = VNET_CRYPTO_ALG_HMAC_SHA384;
412 i = &im->
integ_algs[IPSEC_INTEG_ALG_SHA_512_256];
413 i->
op_id = VNET_CRYPTO_OP_SHA512_HMAC;
414 i->
alg = VNET_CRYPTO_ALG_HMAC_SHA512;
#define vec_validate(V, I)
Make sure vector is long enough for given index (no header, unspecified alignment) ...
u32 ipsec_register_ah_backend(vlib_main_t *vm, ipsec_main_t *im, const char *name, const char *ah4_encrypt_node_name, const char *ah4_decrypt_node_name, const char *ah6_encrypt_node_name, const char *ah6_decrypt_node_name, check_support_cb_t ah_check_support_cb, add_del_sa_sess_cb_t ah_add_del_sa_sess_cb)
u32 esp4_encrypt_next_index
ipsec_main_crypto_alg_t * crypto_algs
ipsec_tunnel_if_t * tunnel_interfaces
ipsec_per_thread_data_t * ptd
u32 esp6_decrypt_node_index
u8 vnet_get_feature_arc_index(const char *s)
u32 ah4_decrypt_next_index
vnet_main_t * vnet_get_main(void)
static void ipsec_add_node(vlib_main_t *vm, const char *node_name, const char *prev_node_name, u32 *out_node_index, u32 *out_next_index)
u32 esp4_decrypt_node_index
ipsec_integ_alg_t integ_alg
u32 ah6_decrypt_next_index
u32 esp6_decrypt_next_index
u32 ah4_encrypt_next_index
u32 ah4_encrypt_node_index
u32 esp6_encrypt_node_index
int ipsec_select_ah_backend(ipsec_main_t *im, u32 backend_idx)
#define vec_validate_aligned(V, I, A)
Make sure vector is long enough for given index (no header, specified alignment)
#define pool_get(P, E)
Allocate an object E from a pool P (unspecified alignment).
u32 ah6_decrypt_node_index
static uword vlib_node_add_next(vlib_main_t *vm, uword node, uword next_node)
uword * spd_index_by_sw_if_index
int vnet_crypto_is_set_handler(vnet_crypto_alg_t alg)
clib_error_t * ipsec_tunnel_if_init(vlib_main_t *vm)
u32 esp6_encrypt_next_index
static clib_error_t * ipsec_check_ah_support(ipsec_sa_t *sa)
u32 ah6_encrypt_node_index
#define VLIB_INIT_FUNCTION(x)
u32 esp6_encrypt_node_index
u32 esp4_decrypt_next_index
u32 ah6_encrypt_next_index
int ipsec_select_esp_backend(ipsec_main_t *im, u32 backend_idx)
#define clib_error_return(e, args...)
check_support_cb_t check_support_cb
clib_error_t *(* add_del_sa_sess_cb_t)(u32 sa_index, u8 is_add)
u32 esp6_encrypt_tun_feature_index
#define vlib_call_init_function(vm, x)
u32 esp6_decrypt_node_index
u32 vnet_get_feature_index(u8 arc, const char *s)
static clib_error_t * vnet_feature_init(vlib_main_t *vm)
u32 ah4_decrypt_node_index
u32 error_drop_node_index
u32 ipsec_register_esp_backend(vlib_main_t *vm, ipsec_main_t *im, const char *name, const char *esp4_encrypt_node_name, const char *esp4_encrypt_node_tun_name, const char *esp4_decrypt_node_name, const char *esp6_encrypt_node_name, const char *esp6_encrypt_node_tun_name, const char *esp6_decrypt_node_name, check_support_cb_t esp_check_support_cb, add_del_sa_sess_cb_t esp_add_del_sa_sess_cb)
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
u32 esp4_encrypt_node_index
clib_error_t * ipsec_check_support_cb(ipsec_main_t *im, ipsec_sa_t *sa)
vnet_crypto_op_id_t enc_op_id
u32 ah4_decrypt_next_index
clib_error_t * ipsec_rsc_in_use(ipsec_main_t *im)
u32 esp4_encrypt_node_index
uword * spd_index_by_spd_id
u32 ah4_decrypt_node_index
clib_error_t * ipsec_add_del_sa_sess_cb(ipsec_main_t *im, u32 sa_index, u8 is_add)
u32 ah6_encrypt_next_index
ipsec_ah_backend_t * ah_backends
u32 esp6_encrypt_tun_feature_index
clib_error_t * ipsec_cli_init(vlib_main_t *vm)
u32 esp4_encrypt_next_index
u32 esp4_encrypt_tun_feature_index
u32 ah4_encrypt_next_index
uword * sa_index_by_sa_id
u32 esp6_decrypt_next_index
#define pool_is_free_index(P, I)
Use free bitmap to query whether given index is free.
vlib_node_t * vlib_get_node_by_name(vlib_main_t *vm, u8 *name)
static clib_error_t * ipsec_init(vlib_main_t *vm)
u32 esp6_encrypt_next_index
static clib_error_t * ipsec_check_esp_support(ipsec_sa_t *sa)
clib_error_t *(* check_support_cb_t)(ipsec_sa_t *sa)
#define hash_create(elts, value_bytes)
vnet_crypto_op_id_t op_id
u32 ah4_encrypt_node_index
ipsec_main_integ_alg_t * integ_algs
u32 esp4_decrypt_node_index
ipsec_protocol_t protocol
add_del_sa_sess_cb_t add_del_sa_sess_cb
vnet_crypto_op_id_t dec_op_id
u32 ah6_decrypt_node_index
u32 ah6_encrypt_node_index
u32 ah6_decrypt_next_index
check_support_cb_t check_support_cb
void ipsec_add_feature(const char *arc_name, const char *node_name, u32 *out_feature_index)
u32 esp4_decrypt_next_index
ipsec_crypto_alg_t crypto_alg
u32 esp4_encrypt_tun_feature_index
static u32 vlib_num_workers()
add_del_sa_sess_cb_t add_del_sa_sess_cb
ipsec_esp_backend_t * esp_backends
#define CLIB_CACHE_LINE_BYTES
static uword pool_elts(void *v)
Number of active elements in a pool.