sa.is_tunnel = 1;
sa.is_tunnel_ip6 = 1;
}
+ else if (unformat (line_input, "udp-encap"))
+ {
+ sa.udp_encap = 1;
+ }
else
{
error = clib_error_return (0, "parse error: '%U'",
goto done;
}
- ipsec_add_del_sa (vm, &sa, is_add, 0 /* enable nat traversal */ );
+ ipsec_add_del_sa (vm, &sa, is_add);
done:
unformat_free (line_input);
ipsec_main_t *im = &ipsec_main;
ipsec_sa_t *sa = 0;
p1 = hash_get (im->sa_index_by_sa_id, p.sa_id);
+ if (!p1)
+ {
+ error =
+ clib_error_return (0, "SA with index %u not found", p.sa_id);
+ goto done;
+ }
sa = pool_elt_at_index (im->sad, p1[0]);
if (sa && sa->protocol == IPSEC_PROTOCOL_AH && is_add && p.is_ipv6)
{
hi = vnet_get_hw_interface (im->vnet_main, t->hw_if_index);
vlib_cli_output(vm, " %s seq", hi->name);
sa = pool_elt_at_index(im->sad, t->output_sa_index);
- vlib_cli_output(vm, " seq %u seq-hi %u esn %u anti-replay %u",
- sa->seq, sa->seq_hi, sa->use_esn, sa->use_anti_replay);
+ vlib_cli_output(vm, " seq %u seq-hi %u esn %u anti-replay %u udp-encap %u",
+ sa->seq, sa->seq_hi, sa->use_esn, sa->use_anti_replay, sa->udp_encap);
vlib_cli_output(vm, " local-spi %u local-ip %U", sa->spi,
format_ip4_address, &sa->tunnel_src_addr.ip4);
vlib_cli_output(vm, " local-crypto %U %U",
a.renumber = 1;
else if (unformat (line_input, "del"))
a.is_add = 0;
+ else if (unformat (line_input, "udp-encap"))
+ a.udp_encap = 1;
else
{
error = clib_error_return (0, "unknown input `%U'",
/* *INDENT-OFF* */
VLIB_CLI_COMMAND (create_ipsec_tunnel_command, static) = {
.path = "create ipsec tunnel",
- .short_help = "create ipsec tunnel local-ip <addr> local-spi <spi> remote-ip <addr> remote-spi <spi> [instance <inst_num>]",
+ .short_help = "create ipsec tunnel local-ip <addr> local-spi <spi> remote-ip <addr> remote-spi <spi> [instance <inst_num>] [udp-encap]",
.function = create_ipsec_tunnel_command_fn,
};
/* *INDENT-ON* */