1 /* Hey Emacs use -*- mode: C -*- */
3 * Copyright (c) 2018 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.
18 * The IPIP module implements IP{v4,v6} over IP{v4,v6} tunnelling as
19 * described in RFC2473 and to some extent the largely historical
20 * RFC1853. The module also supports an IPv4 over IPv6 automatic
21 * tunnelling mechanism called 6RD (RFC5969).
23 * The IPIP API module supports a CRD model for adding, deleting and
24 * listing tunnels. A tunnel is represented as an interface in
25 * VPP. The "handle" representing a tunnel is the sw_if_index. As any
26 * interface, the user must configure an IPv4 and/or IPv6 address on
27 * the interface. This is the inner or payload protocol.
29 * Tunnel MTU: The tunnel MTU (the payload MTU) is configurable per
30 * protocol. If a tunnel MTU is larger than the path MTU, the outer
31 * packet will be fragmented. Fragmentation support is configurable,
32 * as it can have severe performance issues, and might be used as an
33 * attack vector (the remote side must reassemble.)
35 * Traffic class / TOS field can either be configured to a fixed
36 * value, or can be copied from the inner to the outer header.
37 * (For now we have stolen ~0 to indicate copy).
41 * - The Tunnel encapsulation limit described in RFC2473 is not
44 * - ICMP proxying, as in a tunnel head-end receiving ICMP erors on
45 * the outer packet is currently not relayed to the original source
48 * - PMTUD / MTU probing and tunnel keepalives are not yet implemented.
52 option version = "2.0.0";
54 import "vnet/interface_types.api";
55 import "vnet/ip/ip_types.api";
56 import "vnet/ipip/ipip_types.api";
59 * An IP{v4,v6} over IP{v4,v6} tunnel.
63 u32 instance; /* If non-~0, specifies a custom dev instance */
66 vl_api_interface_index_t sw_if_index; /* ignored on create, set in
69 vl_api_ipip_tunnel_flags_t flags;
70 vl_api_ip_dscp_t dscp; /* DSCP value for the tunnel encap,
71 ignored if ECNAP_COPY_DSCP flag is set */
75 * Create an IP{v4,v6} over IP{v4,v6} tunnel.
77 define ipip_add_tunnel
81 vl_api_ipip_tunnel_t tunnel;
84 define ipip_add_tunnel_reply
88 vl_api_interface_index_t sw_if_index;
92 * Delete an IP{v4,v6} over IP{v4,v6} tunnel.
94 autoreply define ipip_del_tunnel
98 vl_api_interface_index_t sw_if_index;
102 * Create an IPv4 over IPv6 automatic tunnel (6RD)
104 define ipip_6rd_add_tunnel
110 vl_api_ip6_prefix_t ip6_prefix;
111 vl_api_ip4_prefix_t ip4_prefix;
112 vl_api_ip4_address_t ip4_src;
114 u8 tc_tos; /* If ~0, the TOS/TC value is copied from
115 inner packet, otherwise set to value */
118 define ipip_6rd_add_tunnel_reply
122 vl_api_interface_index_t sw_if_index;
126 * Delete an IPv4 over IPv6 automatic tunnel (6RD)
128 autoreply define ipip_6rd_del_tunnel
132 vl_api_interface_index_t sw_if_index;
136 * List all IPIP tunnels
138 define ipip_tunnel_dump
142 vl_api_interface_index_t sw_if_index;
145 define ipip_tunnel_details
148 vl_api_ipip_tunnel_t tunnel;