diff options
author | Mohammed Hawari <mohammed@hawari.fr> | 2020-12-01 11:30:57 +0100 |
---|---|---|
committer | Neale Ranns <nranns@cisco.com> | 2020-12-08 16:38:01 +0000 |
commit | 59b792ffb1d77309b0ab17e441fd14237adb74db (patch) | |
tree | f6ea354d07103861147b8e70015eb3d7fc9e50f5 /src/vnet/gre | |
parent | d2fb601022e25055211f6e6ccb960758b8490073 (diff) |
tunnel: add cli support for encap_decap flags
Change-Id: I2bf6ba325975309183dba1e14e9519c944710752
Signed-off-by: Mohammed Hawari <mohammed@hawari.fr>
Type: improvement
Diffstat (limited to 'src/vnet/gre')
-rw-r--r-- | src/vnet/gre/interface.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/vnet/gre/interface.c b/src/vnet/gre/interface.c index ad0efde4345..5e8ad461d93 100644 --- a/src/vnet/gre/interface.c +++ b/src/vnet/gre/interface.c @@ -593,6 +593,7 @@ create_gre_tunnel_command_fn (vlib_main_t * vm, u32 outer_table_id = 0; gre_tunnel_type_t t_type = GRE_TUNNEL_TYPE_L3; tunnel_mode_t t_mode = TUNNEL_MODE_P2P; + tunnel_encap_decap_flags_t flags = TUNNEL_ENCAP_DECAP_FLAG_NONE; u32 session_id = 0; int rv; u8 is_add = 1; @@ -622,6 +623,11 @@ create_gre_tunnel_command_fn (vlib_main_t * vm, else if (unformat (line_input, "erspan %d", &session_id)) t_type = GRE_TUNNEL_TYPE_ERSPAN; else + if (unformat + (line_input, "flags %U", unformat_tunnel_encap_decap_flags, + &flags)) + ; + else { error = clib_error_return (0, "unknown input `%U'", format_unformat_error, line_input); @@ -662,6 +668,7 @@ create_gre_tunnel_command_fn (vlib_main_t * vm, a->session_id = session_id; a->is_ipv6 = !ip46_address_is_ip4 (&src); a->instance = instance; + a->flags = flags; clib_memcpy (&a->src, &src, sizeof (a->src)); clib_memcpy (&a->dst, &dst, sizeof (a->dst)); |