45 "esp4-encrypt-tun" :
"esp6-encrypt-tun");
91 ipsec4_tunnel_key_t
key = {
93 .spi = clib_host_to_net_u32 (sa->
spi),
103 ipsec6_tunnel_key_t
key = {
105 .spi = clib_host_to_net_u32 (sa->
spi),
124 ipsec4_tunnel_key_t key = {
125 .remote_ip = itp->itp_crypto.dst.ip4,
126 .spi = clib_host_to_net_u32 (sa->spi),
136 ipsec6_tunnel_key_t
key = {
138 .spi = clib_host_to_net_u32 (sa->
spi),
161 if (ipsec_sa_is_set_IS_TUNNEL (sa))
165 ipsec_sa_set_IS_PROTECT (sa);
200 ipsec_sa_unset_IS_PROTECT (sa);
220 return (ipsec_protect_db.
tunnels[sw_if_index]);
240 if (~0 == sas_in[ii])
242 rv = VNET_API_ERROR_INVALID_VALUE;
251 rv = VNET_API_ERROR_INVALID_VALUE;
266 if (NULL == dev_class->ip_tun_desc)
268 rv = VNET_API_ERROR_INVALID_SW_IF_INDEX;
276 ipsec_protect_db.
count++;
283 rv = dev_class->ip_tun_desc (sw_if_index,
352 return (VNET_API_ERROR_NO_SUCH_ENTRY);
389 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)
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)
u32 index_t
A Data-Path Object is an object that represents actions that are applied to packets are they are swit...
#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
void ipsec_tun_protect_walk(ipsec_tun_protect_walk_cb_t fn, void *ctx)
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)
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)
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
#define ip46_address_is_ip4(ip46)
static void ipsec_tun_protect_db_remove(ipsec_main_t *im, const ipsec_tun_protect_t *itp)
static int ipsec_tun_protect_feature_set(ipsec_tun_protect_t *itp, u8 enable)
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.
static ipsec_tun_protect_t * ipsec_tun_protect_get(u32 index)
static vlib_main_t * vlib_get_main(void)
#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...
static void hash_set_mem_alloc(uword **h, void *key, uword v)
ipsec_protect_flags_t itp_flags
static void hash_unset_mem_free(uword **h, void *key)
index_t ipsec_tun_protect_find(u32 sw_if_index)
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.
#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