30 u32 dev_instance = va_arg (*args,
u32);
31 return format (s,
"ipsec%d", dev_instance);
38 clib_warning (
"you shouldn't be here, leaking buffers...");
146 (
u8 *) args,
sizeof (*args));
158 u32 hw_if_index = ~0;
169 return VNET_API_ERROR_INVALID_VALUE;
172 memset (t, 0,
sizeof (*t));
175 memset (sa, 0,
sizeof (*sa));
199 memset (sa, 0,
sizeof (*sa));
237 ipsec_hw_class.index,
257 return VNET_API_ERROR_INVALID_VALUE;
303 return VNET_API_ERROR_INVALID_VALUE;
308 return VNET_API_ERROR_INVALID_VALUE;
323 return VNET_API_ERROR_INVALID_VALUE;
326 memset (t, 0,
sizeof (*t));
343 return VNET_API_ERROR_INVALID_VALUE;
365 return VNET_API_ERROR_SYSCALL_ERROR_1;
396 return VNET_API_ERROR_INVALID_VALUE;
410 u32 sa_index, old_sa_index;
420 return VNET_API_ERROR_INVALID_VALUE;
425 clib_warning (
"SA with ID %u is already in use", sa_id);
426 return VNET_API_ERROR_INVALID_VALUE;
432 clib_warning (
"IPsec interface not supported with IPv6 endpoints");
433 return VNET_API_ERROR_UNIMPLEMENTED;
472 return VNET_API_ERROR_SYSCALL_ERROR_1;
VNET_DEVICE_CLASS(ipsec_device_class, static)
#define hash_set(h, key, value)
ipsec_tunnel_if_t * tunnel_interfaces
ip46_address_t tunnel_src_addr
clib_error_t * vnet_hw_interface_set_flags(vnet_main_t *vnm, u32 hw_if_index, u32 flags)
#define hash_unset(h, key)
vnet_main_t * vnet_get_main(void)
vlib_node_registration_t ipsec_if_output_node
(constructor) VLIB_REGISTER_NODE (ipsec_if_output_node)
vnet_interface_main_t interface_main
int ipsec_set_interface_sa(vnet_main_t *vnm, u32 hw_if_index, u32 sa_id, u8 is_outbound)
ipsec_integ_alg_t integ_alg
static vnet_hw_interface_t * vnet_get_hw_interface(vnet_main_t *vnm, u32 hw_if_index)
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
u8 remote_crypto_key[128]
int ipsec_add_del_tunnel_if(ipsec_add_del_tunnel_args_t *args)
static uword dummy_interface_tx(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
u32 ipsec_get_sa_index_by_sa_id(u32 sa_id)
#define VNET_HW_INTERFACE_FLAG_LINK_UP
void ip4_register_protocol(u32 protocol, u32 node_index)
#define pool_get(P, E)
Allocate an object E from a pool P (unspecified alignment).
uword * ipsec_if_pool_index_by_key
clib_error_t * ipsec_tunnel_if_init(vlib_main_t *vm)
#define VLIB_INIT_FUNCTION(x)
vlib_combined_counter_main_t * combined_sw_if_counters
ipsec_main_callbacks_t cb
int ipsec_set_interface_key(vnet_main_t *vnm, u32 hw_if_index, ipsec_if_set_key_type_t type, u8 alg, u8 *key)
u32 vnet_register_interface(vnet_main_t *vnm, u32 dev_class_index, u32 dev_instance, u32 hw_class_index, u32 hw_instance)
static clib_error_t * ipsec_admin_up_down_function(vnet_main_t *vnm, u32 hw_if_index, u32 flags)
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
static void vlib_zero_combined_counter(vlib_combined_counter_main_t *cm, u32 index)
Clear a combined counter Clears the set of per-thread counters.
clib_error_t *(* check_support_cb)(ipsec_sa_t *sa)
#define pool_put(P, E)
Free an object E in pool P.
ip46_address_t tunnel_dst_addr
#define pool_get_aligned(P, E, A)
Allocate an object E from a pool P (general version).
ipsec_crypto_alg_t crypto_alg
static_always_inline uword vlib_get_thread_index(void)
void vl_api_rpc_call_main_thread(void *fp, u8 *data, u32 data_length)
vlib_node_registration_t ipsec_if_input_node
(constructor) VLIB_REGISTER_NODE (ipsec_if_input_node)
#define clib_warning(format, args...)
#define clib_memcpy(a, b, c)
uword * sa_index_by_sa_id
static void vnet_interface_counter_unlock(vnet_interface_main_t *im)
u8 * default_build_rewrite(vnet_main_t *vnm, u32 sw_if_index, vnet_link_t link_type, const void *dst_address)
Return a complete, zero-length (aka dummy) rewrite.
int ipsec_add_del_ipsec_gre_tunnel(vnet_main_t *vnm, ipsec_add_del_ipsec_gre_tunnel_args_t *args)
static void vnet_interface_counter_lock(vnet_interface_main_t *im)
#define hash_create(elts, value_bytes)
u8 ipsec_is_sa_used(u32 sa_index)
#define VNET_SW_INTERFACE_FLAG_ADMIN_UP
static int ipsec_add_del_tunnel_if_rpc_callback(ipsec_add_del_tunnel_args_t *a)
ipsec_integ_alg_t integ_alg
int ipsec_add_del_tunnel_if_internal(vnet_main_t *vnm, ipsec_add_del_tunnel_args_t *args, u32 *sw_if_index)
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
VNET_HW_INTERFACE_CLASS(ipsec_hw_class)
u32 * free_tunnel_if_indices
a point 2 point interface
ipsec_crypto_alg_t crypto_alg
static u8 * format_ipsec_name(u8 *s, va_list *args)
clib_error_t *(* add_del_sa_sess_cb)(u32 sa_index, u8 is_add)
clib_error_t * vnet_sw_interface_set_flags(vnet_main_t *vnm, u32 sw_if_index, u32 flags)
#define CLIB_CACHE_LINE_BYTES
u8 * format_ipsec_if_output_trace(u8 *s, va_list *args)
static uword pool_elts(void *v)
Number of active elements in a pool.