|
FD.io VPP
v21.10.1-2-g0a485f517
Vector Packet Processing
|
Go to the documentation of this file.
53 u32 dev_instance = va_arg (*args,
u32);
54 return format (s,
"ipsec%d", dev_instance);
143 ip46_address_t *
src, ip46_address_t *
dst,
u8 * is_l2)
186 .name =
"IPSEC Tunnel",
209 #define IPSEC_ITF_MAX_INSTANCE (16 * 1024)
281 *sw_if_indexp = (
u32) ~ 0;
289 return VNET_API_ERROR_INVALID_REGISTRATION;
300 ipsec_itf_device_class.index,
302 (
mode == TUNNEL_MODE_P2P ?
303 ipsec_hw_interface_class.index :
304 ipsec_p2mp_hw_interface_class.index),
314 ipsec_itf->ii_sw_if_index = *sw_if_indexp =
hi->sw_if_index;
325 return VNET_API_ERROR_INVALID_SW_IF_INDEX;
329 return VNET_API_ERROR_INVALID_SW_IF_INDEX;
334 return VNET_API_ERROR_INVALID_SW_IF_INDEX;
337 return VNET_API_ERROR_INVALID_SW_IF_INDEX;
412 .path =
"ipsec itf create",
413 .short_help =
"ipsec itf create [instance <instance>]",
463 .path =
"ipsec itf delete",
464 .short_help =
"ipsec itf delete <interface>",
491 .path =
"show ipsec interface",
493 .short_help =
"show ipsec interface",
void ipsec_itf_adj_stack(adj_index_t ai, u32 sai)
#define vec_reset_length(v)
Reset vector length to zero NULL-pointer tolerant.
void vnet_sw_interface_set_mtu(vnet_main_t *vnm, u32 sw_if_index, u32 mtu)
static int ipsec_itf_instance_free(u32 instance)
#define FOR_EACH_FIB_IP_PROTOCOL(_item)
u32 adj_get_sw_if_index(adj_index_t ai)
Return the sw interface index of the adjacency.
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
A dedicated IPSec interface type.
static void ip46_address_reset(ip46_address_t *ip46)
static u8 * ipsec_itf_build_rewrite(void)
enum adj_walk_rc_t_ adj_walk_rc_t
return codes from a adjacency walker callback function
vnet_hw_interface_flags_t flags
#define clib_error_return(e, args...)
void adj_midchain_delegate_stack(adj_index_t ai, u32 fib_index, const fib_prefix_t *pfx)
create/attach a midchain delegate and stack it on the prefix passed
u32 t_fib_index
derived data
vl_api_tunnel_mode_t mode
static ipsec_itf_t * ipsec_itf_find_by_sw_if_index(u32 sw_if_index)
void ip_address_to_fib_prefix(const ip_address_t *addr, fib_prefix_t *prefix)
convert from a IP address to a FIB prefix
@ VNET_SW_INTERFACE_FLAG_ADMIN_UP
#define pool_put(P, E)
Free an object E in pool P.
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
@ VNET_HW_INTERFACE_FLAG_LINK_UP
static vlib_cli_command_t ipsec_interface_show_node
show IPSEC tunnel protection hash tables
static walk_rc_t ipsec_tun_protect_walk_state_change(index_t itpi, void *arg)
void ipsec_itf_update_adj(vnet_main_t *vnm, u32 sw_if_index, adj_index_t ai)
static uword clib_bitmap_first_clear(uword *ai)
Return the lowest numbered clear bit in a bitmap.
static adj_walk_rc_t ipsec_itf_adj_stack_cb(adj_index_t ai, void *arg)
static int ipsec_itf_tunnel_desc(u32 sw_if_index, ip46_address_t *src, ip46_address_t *dst, u8 *is_l2)
#define pool_is_free_index(P, I)
Use free bitmap to query whether given index is free.
#define pool_foreach(VAR, POOL)
Iterate through pool.
static void ipsec_itf_restack(index_t itpi, const ipsec_itf_t *itf)
int ipsec_itf_create(u32 user_instance, tunnel_mode_t mode, u32 *sw_if_indexp)
void ipsec_itf_adj_unstack(adj_index_t ai)
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
static uword clib_bitmap_get(uword *ai, uword i)
Gets the ith bit value from a bitmap.
static ipsec_sa_t * ipsec_sa_get(u32 sa_index)
static vnet_hw_interface_t * vnet_get_hw_interface(vnet_main_t *vnm, u32 hw_if_index)
vnet_main_t * vnet_get_main(void)
u32 index_t
A Data-Path Object is an object that represents actions that are applied to packets are they are swit...
static u8 * format_ipsec_itf_name(u8 *s, va_list *args)
static u32 ipsec_itf_instance_alloc(u32 want)
void vnet_delete_hw_interface(vnet_main_t *vnm, u32 hw_if_index)
walk_rc_t(* ipsec_itf_walk_cb_t)(ipsec_itf_t *itf, void *ctx)
#define pool_get(P, E)
Allocate an object E from a pool P (unspecified alignment).
#define vec_validate(V, I)
Make sure vector is long enough for given index (no header, unspecified alignment)
static_always_inline void mac_address_set_zero(mac_address_t *mac)
#define VLIB_CLI_COMMAND(x,...)
enum fib_protocol_t_ fib_protocol_t
Protocol Type.
static uword * clib_bitmap_set(uword *ai, uword i, uword value)
Sets the ith bit of a bitmap to new_value Removes trailing zeros from the bitmap.
static clib_error_t * ipsec_itf_admin_up_down(vnet_main_t *vnm, u32 hw_if_index, u32 flags)
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)
vnet_sw_interface_t * sw_interfaces
void adj_midchain_delegate_unstack(adj_index_t ai)
unstack a midchain delegate (this stacks it on a drop)
static vlib_cli_command_t ipsec_itf_delete_command
(constructor) VLIB_CLI_COMMAND (ipsec_itf_delete_command)
void adj_nbr_midchain_update_rewrite(adj_index_t adj_index, adj_midchain_fixup_t fixup, const void *fixup_data, adj_flags_t flags, u8 *rewrite)
adj_nbr_midchain_update_rewrite
static u32 * ipsec_itf_index_by_sw_if_index
VNET_DEVICE_CLASS(ipsec_itf_device_class)
static vlib_cli_command_t ipsec_itf_create_command
(constructor) VLIB_CLI_COMMAND (ipsec_itf_create_command)
#define pool_foreach_index(i, v)
format_function_t format_vnet_sw_if_index_name
ipsec_itf_t * ipsec_itf_get(index_t ii)
unformat_function_t unformat_vnet_sw_interface
description fragment has unexpected format
#define vec_validate_init_empty(V, I, INIT)
Make sure vector is long enough for given index and initialize empty space (no header,...
#define IPSEC_ITF_MAX_INSTANCE
static clib_error_t * ipsec_itf_create_cli(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
static vnet_hw_interface_t * vnet_get_sup_hw_interface(vnet_main_t *vnm, u32 sw_if_index)
static clib_error_t * ipsec_interface_show(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
static u8 * ipsec_itf_build_rewrite_i(vnet_main_t *vnm, u32 sw_if_index, vnet_link_t link_type, const void *dst_address)
static ipsec_itf_t * ipsec_itf_pool
u32 adj_index_t
An index for adjacencies.
enum tunnel_mode_t_ tunnel_mode_t
enum vnet_link_t_ vnet_link_t
Link Type: A description of the protocol of packets on the link.
clib_error_t * vnet_hw_interface_set_flags(vnet_main_t *vnm, u32 hw_if_index, vnet_hw_interface_flags_t flags)
@ VNET_HW_INTERFACE_CLASS_FLAG_P2P
a point 2 point interface
void adj_nbr_walk(u32 sw_if_index, fib_protocol_t adj_nh_proto, adj_walk_cb_t cb, void *ctx)
Walk all adjacencies on a link for a given next-hop protocol.
void ipsec_itf_walk(ipsec_itf_walk_cb_t cb, void *ctx)
int ipsec_itf_delete(u32 sw_if_index)
@ VNET_HW_INTERFACE_CLASS_FLAG_NBMA
a non-broadcast multiple access interface
static ipsec_tun_protect_t * ipsec_tun_protect_get(u32 index)
static clib_error_t * ipsec_itf_delete_cli(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
VNET_HW_INTERFACE_CLASS(ipsec_hw_interface_class)
#define INDEX_INVALID
Invalid index - used when no index is known blazoned capitals INVALID speak volumes where ~0 does not...
void ipsec_tun_protect_walk_itf(u32 sw_if_index, ipsec_tun_protect_walk_cb_t fn, void *ctx)
vl_api_interface_index_t sw_if_index
enum walk_rc_t_ walk_rc_t
Walk return code.
@ ADJ_FLAG_MIDCHAIN_IP_STACK
Aggregate type for a prefix.
static uword * ipsec_itf_instances
u32 vnet_register_interface(vnet_main_t *vnm, u32 dev_class_index, u32 dev_instance, u32 hw_class_index, u32 hw_instance)
vnet_interface_main_t interface_main
vl_api_wireguard_peer_flags_t flags