ipsec: CLI improvement for udp port encap 32/31132/2
authorMohammed Hawari <mohammed@hawari.fr>
Fri, 5 Feb 2021 18:04:42 +0000 (19:04 +0100)
committerNeale Ranns <neale@graphiant.com>
Sat, 6 Feb 2021 10:07:48 +0000 (10:07 +0000)
Change-Id: I59f55db7209549ad43a1205470a2f5ea9ea8a1c7
Signed-off-by: Mohammed Hawari <mohammed@hawari.fr>
Type: feature

src/vnet/ipsec/ipsec_cli.c

index 0b0ed6c..b708e50 100644 (file)
@@ -97,6 +97,7 @@ ipsec_sa_add_del_command_fn (vlib_main_t * vm,
   ipsec_key_t ck = { 0 };
   ipsec_key_t ik = { 0 };
   u32 id, spi, salt, sai;
+  int i = 0;
   u16 udp_src, udp_dst;
   int is_add, rv;
   u32 m_args = 0;
@@ -158,6 +159,10 @@ ipsec_sa_add_del_command_fn (vlib_main_t * vm,
       else if (unformat (line_input, "tunnel-dst %U",
                         unformat_ip46_address, &tun_dst, IP46_TYPE_ANY))
        ;
+      else if (unformat (line_input, "udp-src-port %d", &i))
+       udp_src = i;
+      else if (unformat (line_input, "udp-dst-port %d", &i))
+       udp_dst = i;
       else if (unformat (line_input, "tx-table-id %d", &tx_table_id))
        ;
       else if (unformat (line_input, "inbound"))