2 * tunnel.h: shared definitions for tunnels.
4 * Copyright (c) 2019 Cisco and/or its affiliates.
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at:
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
18 #include <vnet/tunnel/tunnel.h>
21 format_tunnel_mode (u8 * s, va_list * args)
23 tunnel_mode_t mode = va_arg (*args, int);
27 #define _(n, v) case TUNNEL_MODE_##n: \
28 s = format (s, "%s", v); \
38 unformat_tunnel_mode (unformat_input_t * input, va_list * args)
40 tunnel_mode_t *m = va_arg (*args, tunnel_mode_t *);
42 if (unformat (input, "p2p"))
44 else if (unformat (input, "p2mp") || unformat (input, "mp"))
52 format_tunnel_encap_decap_flags (u8 * s, va_list * args)
54 tunnel_encap_decap_flags_t f = va_arg (*args, int);
56 if (f == TUNNEL_ENCAP_DECAP_FLAG_NONE)
57 return (format (s, "none"));
59 #define _(a,b,c) if (f & TUNNEL_ENCAP_DECAP_FLAG_##a) s = format(s, "%s ", b);
60 forech_tunnel_encap_decap_flag
67 * fd.io coding-style-patch-verification: ON
70 * eval: (c-set-style "gnu")