summaryrefslogtreecommitdiffstats
path: root/src/vnet/tunnel
diff options
context:
space:
mode:
authorMohammed Hawari <mohammed@hawari.fr>2020-12-01 11:30:57 +0100
committerNeale Ranns <nranns@cisco.com>2020-12-08 16:38:01 +0000
commit59b792ffb1d77309b0ab17e441fd14237adb74db (patch)
treef6ea354d07103861147b8e70015eb3d7fc9e50f5 /src/vnet/tunnel
parentd2fb601022e25055211f6e6ccb960758b8490073 (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/tunnel')
-rw-r--r--src/vnet/tunnel/tunnel.c14
-rw-r--r--src/vnet/tunnel/tunnel.h4
2 files changed, 16 insertions, 2 deletions
diff --git a/src/vnet/tunnel/tunnel.c b/src/vnet/tunnel/tunnel.c
index 96d7fd12b52..38bde34e7f2 100644
--- a/src/vnet/tunnel/tunnel.c
+++ b/src/vnet/tunnel/tunnel.c
@@ -62,6 +62,20 @@ format_tunnel_encap_decap_flags (u8 * s, va_list * args)
return (s);
}
+uword
+unformat_tunnel_encap_decap_flags (unformat_input_t * input, va_list * args)
+{
+ tunnel_encap_decap_flags_t *f =
+ va_arg (*args, tunnel_encap_decap_flags_t *);
+#define _(a,b,c) if (unformat(input, b)) {\
+ *f |= TUNNEL_ENCAP_DECAP_FLAG_##a;\
+ return 1;\
+ }
+ forech_tunnel_encap_decap_flag;
+#undef _
+ return 0;
+}
+
/*
* fd.io coding-style-patch-verification: ON
diff --git a/src/vnet/tunnel/tunnel.h b/src/vnet/tunnel/tunnel.h
index f23a3d41924..6c97fc13ab4 100644
--- a/src/vnet/tunnel/tunnel.h
+++ b/src/vnet/tunnel/tunnel.h
@@ -55,9 +55,9 @@ typedef enum tunnel_encap_decap_flags_t_
#define TUNNEL_FLAG_MASK (0x1f)
extern u8 *format_tunnel_encap_decap_flags (u8 * s, va_list * args);
-
+extern uword
+unformat_tunnel_encap_decap_flags (unformat_input_t * input, va_list * args);
#endif
-
/*
* fd.io coding-style-patch-verification: ON
*