1 /* Hey Emacs use -*- mode: C -*- */
3 * Copyright (c) 2019 Cisco and/or its affiliates.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at:
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
16 option version = "1.0.1";
18 import "vnet/interface_types.api";
19 import "vnet/ip/ip_types.api";
22 * Flags controlling tunnel behaviour
24 enum tunnel_encap_decap_flags : u8
26 TUNNEL_API_ENCAP_DECAP_FLAG_NONE = 0,
27 /** at encap, copy the DF bit of the payload into the tunnel header */
28 TUNNEL_API_ENCAP_DECAP_FLAG_ENCAP_COPY_DF = 0x1,
29 /** at encap, set the DF bit in the tunnel header */
30 TUNNEL_API_ENCAP_DECAP_FLAG_ENCAP_SET_DF = 0x2,
31 /** at encap, copy the DSCP bits of the payload into the tunnel header */
32 TUNNEL_API_ENCAP_DECAP_FLAG_ENCAP_COPY_DSCP = 0x4,
33 /** at encap, copy the ECN bit of the payload into the tunnel header */
34 TUNNEL_API_ENCAP_DECAP_FLAG_ENCAP_COPY_ECN = 0x8,
35 /** at decap, copy the ECN bit of the tunnel header into the payload */
36 TUNNEL_API_ENCAP_DECAP_FLAG_DECAP_COPY_ECN = 0x10,
37 /** at encap, compute flow hash on the inner packet for more entropy */
38 TUNNEL_API_ENCAP_DECAP_FLAG_ENCAP_INNER_HASH = 0x20 [backwards_compatible],
39 /** at encap, copy the hop-limit/TTL of the payload into the tunnel header */
40 TUNNEL_API_ENCAP_DECAP_FLAG_ENCAP_COPY_HOP_LIMIT = 0x40 [backwards_compatible],
41 /** at encap, copy the Flow Label of the payload into the tunnel header */
42 TUNNEL_API_ENCAP_DECAP_FLAG_ENCAP_COPY_FLOW_LABEL = 0x80 [backwards_compatible],
51 TUNNEL_API_MODE_P2P = 0,
59 enumflag tunnel_flags : u8
62 * the tunnel's MTU tracks the MTU of its destination
63 * Currently NOT IMPLEMENTATION (this is a API place-holder)
65 TUNNEL_API_FLAG_TRACK_MTU = 0x1,
69 * An IP{v4,v6} tunnel.
73 /** If non-~0, specifies a custom dev instance */
75 /** Tunnel source and destination address */
78 /** ignored on create, set in details/dump */
79 vl_api_interface_index_t sw_if_index;
80 /** The table ID in which the source and destination addresses are valid */
82 vl_api_tunnel_encap_decap_flags_t encap_decap_flags;
83 vl_api_tunnel_mode_t mode;
84 vl_api_tunnel_flags_t flags;
85 /* DSCP value for the tunnel encap, ignored if ECNAP_COPY_DSCP flag is set */
86 vl_api_ip_dscp_t dscp;
87 /* TTL=0 is considered 255 */
93 * eval: (c-set-style "gnu")