41 "[%d] %U (src) %U (dst) local-sa %d remote-sa %d",
63 vlib_cli_output (vm,
"%U", format_ipsec_gre_tunnel, t);
72 .path =
"show ipsec gre tunnel",
114 return VNET_API_ERROR_INVALID_VALUE;
188 return VNET_API_ERROR_NO_SUCH_ENTRY;
256 if (memcmp (&a->
src, &a->
dst, sizeof (a->
src)) == 0)
270 case VNET_API_ERROR_INVALID_VALUE:
275 "vnet_ipsec_gre_tunnel_add_del returned %d",
288 .path =
"create ipsec gre tunnel",
289 .short_help =
"create ipsec gre tunnel src <addr> dst <addr> " 290 "local-sa <id> remote-sa <id> [del]",
#define hash_set(h, key, value)
ip4_address_t tunnel_dst
tunnel IPv4 dst address
#define hash_unset(h, key)
vnet_main_t * vnet_get_main(void)
u32 remote_sa
remote IPSec SA index
L2-GRE over IPSec packet processing.
vnet_interface_main_t interface_main
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).
static clib_error_t * show_ipsec_gre_tunnel_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
clib_memset(h->entries, 0, sizeof(h->entries[0])*entries)
u8 * format_ipsec_gre_tunnel(u8 *s, va_list *args)
int vnet_ipsec_gre_tunnel_add_del(const ipsec_gre_tunnel_add_del_args_t *a, u32 *sw_if_indexp)
Add or delete ipsec-gre tunnel interface.
format_function_t format_vnet_sw_if_index_name
#define clib_memcpy(d, s, n)
#define IPSEC_GRE_OUTPUT_NEXT_ESP_ENCRYPT
ipsec_gre_tunnel_t * tunnels
pool of tunnel instances
#define pool_foreach(VAR, POOL, BODY)
Iterate through pool.
#define VLIB_INIT_FUNCTION(x)
vlib_combined_counter_main_t * combined_sw_if_counters
ipsec_gre_main_t ipsec_gre_main
uword vlib_node_add_next_with_slot(vlib_main_t *vm, uword node_index, uword next_node_index, uword slot)
#define clib_error_return(e, args...)
vnet_hw_interface_class_t ipsec_gre_hw_interface_class
u32 vnet_register_interface(vnet_main_t *vnm, u32 dev_class_index, u32 dev_instance, u32 hw_class_index, u32 hw_instance)
int ipsec_add_del_ipsec_gre_tunnel(vnet_main_t *vnm, const ipsec_gre_tunnel_add_del_args_t *args)
u32 sw_if_index
hardware interface index
u32 remote_sa_id
remote IPSec SA id
uword * tunnel_by_key
hash mapping src/dst addr pair to tunnel
#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 * ipsec_gre_interface_init(vlib_main_t *vm)
void ip4_sw_interface_enable_disable(u32 sw_if_index, u32 is_enable)
u32 esp4_encrypt_node_index
#define pool_put(P, E)
Free an object E in pool P.
u32 local_sa
local IPSec SA index
vlib_simple_counter_main_t * sw_if_counters
#define pool_get_aligned(P, E, A)
Allocate an object E from a pool P with alignment A.
u32 ipsec_get_sa_index_by_sa_id(u32 sa_id)
u32 * tunnel_index_by_sw_if_index
mapping from sw_if_index to tunnel index
static void vnet_interface_counter_unlock(vnet_interface_main_t *im)
#define VLIB_CLI_COMMAND(x,...)
static void vnet_interface_counter_lock(vnet_interface_main_t *im)
vnet_device_class_t ipsec_gre_device_class
IPSec-GRE tunnel parameters.
static void vlib_zero_simple_counter(vlib_simple_counter_main_t *cm, u32 index)
Clear a simple counter Clears the set of per-thread u16 counters, and the u64 counter.
vnet_main_t * vnet_main
convenience
u32 local_sa_id
local IPSec SA id
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
void vnet_sw_interface_set_mtu(vnet_main_t *vnm, u32 sw_if_index, u32 mtu)
u32 * free_ipsec_gre_tunnel_hw_if_indices
free vlib hw_if_indices
clib_error_t * vnet_sw_interface_set_flags(vnet_main_t *vnm, u32 sw_if_index, vnet_sw_interface_flags_t flags)
static clib_error_t * create_ipsec_gre_tunnel_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
#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)
#define CLIB_CACHE_LINE_BYTES
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)
vlib_main_t * vlib_main
convenience
ip4_address_t tunnel_src
tunnel IPv4 src address
static uword pool_elts(void *v)
Number of active elements in a pool.