117 ipsec4_tunnel_key_t
key = {
119 .spi = clib_host_to_net_u32 (sa->
spi),
129 ipsec6_tunnel_key_t
key = {
131 .spi = clib_host_to_net_u32 (sa->
spi),
150 ipsec4_tunnel_key_t key = {
151 .remote_ip = itp->itp_crypto.dst.ip4,
152 .spi = clib_host_to_net_u32 (sa->spi),
162 ipsec6_tunnel_key_t
key = {
164 .spi = clib_host_to_net_u32 (sa->
spi),
194 if (ipsec_sa_is_set_IS_TUNNEL (sa))
198 ipsec_sa_set_IS_PROTECT (sa);
232 ipsec_sa_unset_IS_PROTECT (sa);
252 return (ipsec_protect_db.
tunnels[sw_if_index]);
270 u32 itpi, *sas_in, sai, *saip;
284 return (VNET_API_ERROR_INVALID_INTERFACE);
302 rv = VNET_API_ERROR_INVALID_VALUE;
334 return (VNET_API_ERROR_INVALID_INTERFACE);
341 rv = VNET_API_ERROR_INVALID_VALUE;
378 if (~0 == sas_in[ii])
380 rv = VNET_API_ERROR_INVALID_VALUE;
389 rv = VNET_API_ERROR_INVALID_VALUE;
404 if (
NULL == dev_class->ip_tun_desc)
406 rv = VNET_API_ERROR_INVALID_SW_IF_INDEX;
414 ipsec_protect_db.
count++;
421 rv = dev_class->ip_tun_desc (sw_if_index,
493 return (VNET_API_ERROR_NO_SUCH_ENTRY);
530 sizeof (ipsec6_tunnel_key_t),
#define vec_foreach_index(var, v)
Iterate over vector indices.
walk_rc_t(* ipsec_tun_protect_walk_cb_t)(index_t itpi, void *arg)
#define hash_set(h, key, value)
static void ipsec_tun_protect_db_add(ipsec_main_t *im, const ipsec_tun_protect_t *itp)
ip46_address_t tunnel_src_addr
uword * tun6_protect_by_key
#define hash_unset(h, key)
u8 vnet_get_feature_arc_index(const char *s)
void ip6_register_protocol(u32 protocol, u32 node_index)
vlib_node_registration_t ipsec6_tun_input_node
(constructor) VLIB_REGISTER_NODE (ipsec6_tun_input_node)
vnet_main_t * vnet_get_main(void)
static vnet_hw_interface_t * vnet_get_sup_hw_interface(vnet_main_t *vnm, u32 sw_if_index)
#define pool_get_zero(P, E)
Allocate an object E from a pool P and zero it.
void ip6_unregister_protocol(u32 protocol)
ipsec_integ_alg_t integ_alg
u32 esp46_encrypt_tun_feature_index
void ipsec_sa_lock(index_t sai)
u32 index_t
A Data-Path Object is an object that represents actions that are applied to packets are they are swit...
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
#define FOR_EACH_IPSEC_PROTECT_INPUT_SA(_itp, _sa, body)
struct _vnet_device_class vnet_device_class_t
void ip4_register_protocol(u32 protocol, u32 node_index)
static ipsec_protect_db_t ipsec_protect_db
static u8 ip46_address_is_ip4(const ip46_address_t *ip46)
void ipsec_tun_protect_walk(ipsec_tun_protect_walk_cb_t fn, void *ctx)
u32 esp44_encrypt_tun_feature_index
vl_api_interface_index_t sw_if_index
#define VLIB_INIT_FUNCTION(x)
static vnet_device_class_t * vnet_get_device_class(vnet_main_t *vnm, u32 dev_class_index)
static void ipsec_tun_protect_unconfig(ipsec_main_t *im, ipsec_tun_protect_t *itp)
int vnet_feature_enable_disable_with_index(u8 arc_index, u32 feature_index, u32 sw_if_index, int enable_disable, void *feature_config, u32 n_feature_config_bytes)
vlib_node_registration_t ipsec4_tun_input_node
(constructor) VLIB_REGISTER_NODE (ipsec4_tun_input_node)
#define hash_create_mem(elts, key_bytes, value_bytes)
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
index_t ipsec_sa_find_and_lock(u32 id)
int ipsec_tun_protect_update_in(u32 sw_if_index, u32 sa_in)
static void ipsec_tun_protect_feature_set(ipsec_tun_protect_t *itp, u8 enable)
static void ipsec_tun_protect_config(ipsec_main_t *im, ipsec_tun_protect_t *itp, u32 sa_out, u32 *sas_in)
#define pool_put(P, E)
Free an object E in pool P.
int ipsec_tun_protect_del(u32 sw_if_index)
static ipsec_sa_t * ipsec_sa_get(u32 sa_index)
ip46_address_t tunnel_dst_addr
static void ipsec_tun_protect_db_remove(ipsec_main_t *im, const ipsec_tun_protect_t *itp)
u32 esp4_no_crypto_tun_feature_index
int ipsec_tun_protect_update(u32 sw_if_index, u32 sa_out, u32 *sas_in)
#define vec_free(V)
Free vector's memory (no header).
clib_error_t * ipsec_tunnel_protect_init(vlib_main_t *vm)
void udp_unregister_dst_port(vlib_main_t *vm, udp_dst_port_t dst_port, u8 is_ip4)
#define FOR_EACH_IPSEC_PROTECT_INPUT_SAI(_itp, _sai, body)
void ipsec_sa_unlock(index_t sai)
#define hash_create(elts, value_bytes)
static uword hash_elts(void *v)
ipsec_tun_protect_t * ipsec_protect_pool
Pool of tunnel protection objects.
int ipsec_tun_protect_update_out(u32 sw_if_index, u32 sa_out)
static ipsec_tun_protect_t * ipsec_tun_protect_get(u32 index)
u32 esp64_encrypt_tun_feature_index
static void hash_unset_mem_free(uword **h, const void *key)
static vlib_main_t * vlib_get_main(void)
u32 esp66_encrypt_tun_feature_index
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
#define INDEX_INVALID
Invalid index - used when no index is known blazoned capitals INVALID speak volumes where ~0 does not...
int ipsec_tun_protect_update_one(u32 sw_if_index, u32 sa_out, u32 sa_in)
ipsec_protect_flags_t itp_flags
void ipsec_add_feature(const char *arc_name, const char *node_name, u32 *out_feature_index)
ipsec_crypto_alg_t crypto_alg
index_t ipsec_tun_protect_find(u32 sw_if_index)
#define vec_foreach(var, vec)
Vector iterator.
static void hash_set_mem_alloc(uword **h, const void *key, uword v)
void udp_register_dst_port(vlib_main_t *vm, udp_dst_port_t dst_port, u32 node_index, u8 is_ip4)
#define pool_foreach_index(i, v, body)
Iterate pool by index.
u32 esp6_no_crypto_tun_feature_index
#define vec_validate_init_empty(V, I, INIT)
Make sure vector is long enough for given index and initialize empty space (no header, unspecified alignment)
struct ipsec_protect_db_t_ ipsec_protect_db_t
DB of protected tunnels.
void ip4_unregister_protocol(u32 protocolx)
int vnet_feature_enable_disable(const char *arc_name, const char *node_name, u32 sw_if_index, int enable_disable, void *feature_config, u32 n_feature_config_bytes)
uword * tun4_protect_by_key