blob: de06b6002f55d993915163b2482164204482cf4e [file] [log] [blame]
Neale Ranns59ff9182019-12-29 23:55:18 +00001/*
2 * tunnel.h: shared definitions for tunnels.
3 *
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:
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
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.
16 */
17
18#ifndef __TUNNEL_H__
19#define __TUNNEL_H__
20
21#include <vlib/vlib.h>
22
Neale Ranns14053c92019-12-29 23:55:18 +000023#define foreach_tunnel_mode \
Neale Ranns59ff9182019-12-29 23:55:18 +000024 _(P2P, "point-to-point") \
25 _(MP, "multi-point") \
26
27typedef enum tunnel_mode_t_
28{
29#define _(n, s) TUNNEL_MODE_##n,
30 foreach_tunnel_mode
31#undef _
32} __clib_packed tunnel_mode_t;
33
34extern u8 *format_tunnel_mode (u8 * s, va_list * args);
Neale Ranns14053c92019-12-29 23:55:18 +000035extern uword unformat_tunnel_mode (unformat_input_t * input, va_list * args);
Neale Ranns59ff9182019-12-29 23:55:18 +000036
37/**
38 * Keep these idenitical to those in ipip.api
39 */
Neale Ranns14053c92019-12-29 23:55:18 +000040#define forech_tunnel_encap_decap_flag \
Neale Ranns59ff9182019-12-29 23:55:18 +000041 _(NONE, "none", 0x0) \
42 _(ENCAP_COPY_DF, "encap-copy-df", 0x1) \
43 _(ENCAP_SET_DF, "encap-set-df", 0x2) \
44 _(ENCAP_COPY_DSCP, "encap-copy-dscp", 0x4) \
45 _(ENCAP_COPY_ECN, "encap-copy-ecn", 0x8) \
Mohammed Hawari33c45f52020-11-30 13:50:24 +010046 _(DECAP_COPY_ECN, "decap-copy-ecn", 0x10) \
47 _(ENCAP_INNER_HASH, "encap-inner-hash", 0x20)
Neale Ranns59ff9182019-12-29 23:55:18 +000048
49typedef enum tunnel_encap_decap_flags_t_
50{
51#define _(a,b,c) TUNNEL_ENCAP_DECAP_FLAG_##a = c,
52 forech_tunnel_encap_decap_flag
53#undef _
54} __clib_packed tunnel_encap_decap_flags_t;
55
56#define TUNNEL_FLAG_MASK (0x1f)
57
58extern u8 *format_tunnel_encap_decap_flags (u8 * s, va_list * args);
Mohammed Hawari59b792f2020-12-01 11:30:57 +010059extern uword
60unformat_tunnel_encap_decap_flags (unformat_input_t * input, va_list * args);
Neale Ranns59ff9182019-12-29 23:55:18 +000061#endif
Neale Ranns59ff9182019-12-29 23:55:18 +000062/*
63 * fd.io coding-style-patch-verification: ON
64 *
65 * Local Variables:
66 * eval: (c-set-style "gnu")
67 * End:
68 */