IPIP tunnel: use address types on API
[vpp.git] / src / vnet / ipip / ipip.api
1 /* Hey Emacs use -*- mode: C -*- */
2 /*
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:
7  *
8  *     http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  */
16
17 /**
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).
22  *
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.
28  *
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.)
34  *
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).
38  *
39  * Note:
40  *
41  * - The Tunnel encapsulation limit described in RFC2473 is not
42  *   implemented.
43  *
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
46  *   of the packet.
47  *
48  * - PMTUD / MTU probing and tunnel keepalives are not yet implemented.
49  *
50  */
51
52 option version = "1.2.0";
53 import "vnet/interface_types.api";
54 import "vnet/ip/ip_types.api";
55
56 /**
57  * An IP{v4,v6} over IP{v4,v6} tunnel.
58  */
59 typedef ipip_tunnel
60 {
61   u32 instance;         /* If non-~0, specifies a custom dev instance */
62   vl_api_address_t src;
63   vl_api_address_t dst;
64   u32 sw_if_index; /* ignored on create, set in details/dump */
65 u32 table_id;
66   u8 tc_tos;            /* If ~0, the TOS/TC value is copied from
67                            inner packet, otherwise set to value */
68 };
69
70 /**
71  * Create an IP{v4,v6} over IP{v4,v6} tunnel.
72  */
73 define ipip_add_tunnel
74 {
75   u32 client_index;
76   u32 context;
77   vl_api_ipip_tunnel_t tunnel;
78 };
79
80 define ipip_add_tunnel_reply
81 {
82   u32 context;
83   i32 retval;
84   vl_api_interface_index_t sw_if_index;
85 };
86
87 /**
88  * Delete an IP{v4,v6} over IP{v4,v6} tunnel.
89  */
90 autoreply define ipip_del_tunnel
91 {
92   u32 client_index;
93   u32 context;
94   vl_api_interface_index_t sw_if_index;
95 };
96
97 /**
98  * Create an IPv4 over IPv6 automatic tunnel (6RD)
99  */
100 define ipip_6rd_add_tunnel
101 {
102   u32 client_index;
103   u32 context;
104   u32 ip6_table_id;
105   u32 ip4_table_id;
106   u8 ip6_prefix[16];
107   u8 ip4_prefix[4];
108   u8 ip4_src[4];
109   u8 ip6_prefix_len;
110   u8 ip4_prefix_len;
111   u8 security_check;
112   u8 tc_tos;            /* If ~0, the TOS/TC value is copied from
113                            inner packet, otherwise set to value */
114 };
115
116 define ipip_6rd_add_tunnel_reply
117 {
118   u32 context;
119   i32 retval;
120   vl_api_interface_index_t sw_if_index;
121 };
122
123 /**
124  * Delete an IPv4 over IPv6 automatic tunnel (6RD)
125  */
126 autoreply define ipip_6rd_del_tunnel
127 {
128   u32 client_index;
129   u32 context;
130   vl_api_interface_index_t sw_if_index;
131 };
132
133 /**
134  * List all IPIP tunnels
135  */
136 define ipip_tunnel_dump
137 {
138   u32 client_index;
139   u32 context;
140   vl_api_interface_index_t sw_if_index;
141 };
142
143 define ipip_tunnel_details
144 {
145   u32 context;
146   vl_api_ipip_tunnel_t tunnel;
147 };
148
149 /*
150  * Local Variables:
151  * eval: (c-set-style "gnu")
152  * End:
153  */