40 "[%d] %U (src) %U (dst) local-sa %d remote-sa %d",
62 vlib_cli_output (vm,
"%U", format_ipsec_gre_tunnel, t);
71 .path =
"show ipsec gre tunnel",
101 u32 hw_if_index, sw_if_index;
107 memset (&args, 0,
sizeof (args));
121 return VNET_API_ERROR_INVALID_VALUE;
124 memset (t, 0,
sizeof (*t));
200 return VNET_API_ERROR_NO_SUCH_ENTRY;
217 *sw_if_indexp = sw_if_index;
231 u32 lsa = 0, rsa = 0;
249 else if (
unformat (line_input,
"local-sa %d", &lsa))
251 else if (
unformat (line_input,
"remote-sa %d", &rsa))
267 if (memcmp (&src, &dst,
sizeof (src)) == 0)
273 memset (a, 0,
sizeof (*a));
288 case VNET_API_ERROR_INVALID_VALUE:
293 "vnet_ipsec_gre_add_del_tunnel returned %d",
306 .path =
"create ipsec gre tunnel",
307 .short_help =
"create ipsec gre tunnel src <addr> dst <addr> " 308 "local-sa <id> remote-sa <id> [del]",
#define vec_validate(V, I)
Make sure vector is long enough for given index (no header, unspecified alignment) ...
#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
uword vlib_node_add_named_next_with_slot(vlib_main_t *vm, uword node, char *name, uword slot)
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)
u32 * fib_index_by_sw_if_index
Table index indexed by software interface.
u32 ipsec_get_sa_index_by_sa_id(u32 sa_id)
u8 * format_ipsec_gre_tunnel(u8 *s, va_list *args)
format_function_t format_vnet_sw_if_index_name
#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
int ipsec_add_del_ipsec_gre_tunnel(vnet_main_t *vnm, ipsec_add_del_ipsec_gre_tunnel_args_t *args)
#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)
u32 sw_if_index
hardware interface index
u32 remote_sa_id
remote IPSec SA id
IPSec-GRE tunnel add/del arguments.
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)
#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 (general version).
u8 is_add
1 - add, 0 - delete
u32 * tunnel_index_by_sw_if_index
mapping from sw_if_index to tunnel index
#define clib_memcpy(a, b, c)
static void vnet_interface_counter_unlock(vnet_interface_main_t *im)
u32 rsa
remote IPSec SA id
int vnet_ipsec_gre_add_del_tunnel(vnet_ipsec_gre_add_del_tunnel_args_t *a, u32 *sw_if_indexp)
Add or delete ipsec-gre tunnel interface.
#define VLIB_CLI_COMMAND(x,...)
static void vnet_interface_counter_lock(vnet_interface_main_t *im)
ip4_address_t src
tunnel IPv4 src address
u32 max_l3_packet_bytes[VLIB_N_RX_TX]
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
ip4_address_t dst
tunnel IPv4 dst address
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
u32 * free_ipsec_gre_tunnel_hw_if_indices
free vlib hw_if_indices
ip4_main_t ip4_main
Global ip4 main structure.
clib_error_t * vnet_sw_interface_set_flags(vnet_main_t *vnm, u32 sw_if_index, u32 flags)
static clib_error_t * create_ipsec_gre_tunnel_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
u32 per_packet_overhead_bytes
#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.