diff options
Diffstat (limited to 'src/vnet/tunnel')
-rw-r--r-- | src/vnet/tunnel/tunnel.c | 14 | ||||
-rw-r--r-- | src/vnet/tunnel/tunnel.h | 4 |
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 * |